CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: Date Entered: 4/9/2008 10:39:28 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 128 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
"sagarkandekar"
NewsGroup User
Enable linkButton's after clicking the another linkbutton4/9/2008 10:39:28 AM

0

 Hi,

I want to Enable linkbutton's after clicking the another linkbutton.

Here is my code in Gridview

<asp:TemplateField HeaderText="Download" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Left">
                                 <ItemTemplate >
                                 <asp:LinkButton ID="LinkButton2" Text="Download"  runat="server" commandname="Downl">
                                 </asp:LinkButton>
                                 </ItemTemplate>
                                 </asp:TemplateField>
                                  <asp:TemplateField HeaderText="Approval"  ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Left">
                                 <ItemTemplate >
                                 <asp:LinkButton ID="Approval" Text="Approval"  runat="server" commandname="Approval" Enanled=False>
                                 </asp:LinkButton>
                                 </ItemTemplate>
                                 </asp:TemplateField>
                                  <asp:TemplateField HeaderText="Rework" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Left">
                                 <ItemTemplate >
                                 <asp:LinkButton ID="Rework" Text="Rework"  runat="server" commandname="Rework" Enanled=False >
                                 </asp:LinkButton>
                                 </ItemTemplate>
                                 </asp:TemplateField >
                                 <asp:TemplateField HeaderText="Comment" ItemStyle-Width="75"  HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
                                 <ItemTemplate>
                                 <asp:Button Text="..." ID="CmtBtn" runat="server" CommandName="Comment" Enanled=False/>
                                 </ItemTemplate>
                                 </asp:TemplateField>

 After Clicking the Download linkbutton ;Approval,Rework,Commentbutton should get "Enanled=true"

 Plz Help me.

Sagar Kandekar. 

"Hong-Gang Chen
NewsGroup User
Re: Enable linkButton's after clicking the another linkbutton4/14/2008 10:43:29 AM

0

sagarkandekar:

 Hi,

I want to Enable linkbutton's after clicking the another linkbutton.

Here is my code in Gridview

<asp:TemplateField HeaderText="Download" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Left">
                                 <ItemTemplate >
                                 <asp:LinkButton ID="LinkButton2" Text="Download"  runat="server" commandname="Downl">
                                 </asp:LinkButton>
                                 </ItemTemplate>
                                 </asp:TemplateField>
                                  <asp:TemplateField HeaderText="Approval"  ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Left">
                                 <ItemTemplate >
                                 <asp:LinkButton ID="Approval" Text="Approval"  runat="server" commandname="Approval" Enanled=False>
                                 </asp:LinkButton>
                                 </ItemTemplate>
                                 </asp:TemplateField>
                                  <asp:TemplateField HeaderText="Rework" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Left">
                                 <ItemTemplate >
                                 <asp:LinkButton ID="Rework" Text="Rework"  runat="server" commandname="Rework" Enanled=False >
                                 </asp:LinkButton>
                                 </ItemTemplate>
                                 </asp:TemplateField >
                                 <asp:TemplateField HeaderText="Comment" ItemStyle-Width="75"  HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
                                 <ItemTemplate>
                                 <asp:Button Text="..." ID="CmtBtn" runat="server" CommandName="Comment" Enanled=False/>
                                 </ItemTemplate>
                                 </asp:TemplateField>

 After Clicking the Download linkbutton ;Approval,Rework,Commentbutton should get "Enanled=true"

 

 Hi Sagar Kandekar,

Base on my experience, I think you can refer the following code to solve your problem:

    GridViewRow gvr = GridView1.SelectedRow;
        LinkButton LinkButton2 = new LinkButton();
        LinkButton Approval = new LinkButton();
        LinkButton Rework = new LinkButton();
        int n = 2;

        LinkButton2 = gvr.Cells[n].FindControl("LinkButton2") as LinkButton;
        Approval = gvr.Cells[n + 1].FindControl("Approval") as LinkButton;
        Rework = gvr.Cells[n + 2].FindControl("Rework") as LinkButton;

        LinkButton2.Enabled = true;
        Approval.Enabled = true;
        Rework.Enabled = true;

To know more, please refer this link:

http://msdn2.microsoft.com/en-us/library/bb288032.aspx

Hope it helps,

Hong Gang


Sincerely,
Hong Gang Chen
Microsoft Online Community Support
Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
"DigiMortal" <>
NewsGroup User
Re: Enable linkButton's after clicking the another linkbutton4/14/2008 10:54:36 AM

0

You should use similiar code in GridView's ItemCommand event. You will get the row where button was clicked with event arguments. Then use the code given in previous message.
www.developers-team.com
Always under construction!

Also visit my ASP.NET blog!
"ajmalmcs1" <>
NewsGroup User
Re: Enable linkButton's after clicking the another linkbutton4/14/2008 12:39:18 PM

0

I think you can use

 

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand

Try

If e.CommandName = "Downl" Then

Dim row As GridViewRow = CType(CType(e.CommandSource, Control).NamingContainer, GridViewRow)

CType(row.FindControl("Approval"), LinkButton).Enabled = True

CType(row.FindControl("Rework"), LinkButton).Enabled = True

CType(row.FindControl("CmtBtn"), LinkButton).Enabled = True

 

 

End If

Catch ex As Exception

End Try

End Sub


ajmal khan
4 Items, 1 Pages 1 |< << Go >> >|




   
  Privacy | Contact Us
All Times Are GMT