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.