Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I use a ImageButton in gridview and i want to find this Imagebutton on pageload using find control. can u give me a solid answer of this question......

XML
<asp:TemplateField HeaderText="Approval">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="IsAppovedByAcc" runat="server" ImageUrl="~/images/smallsuccess.gif"
                                            OnClientClick='<%# showApproval("approved",Eval("CustName").ToString(),Eval("SNo").ToString(),Eval("Status").ToString(),Eval("CustomerCode").ToString())  %>' />
                                        <asp:ImageButton ID="UnapprovedByAcc" runat="server" ImageUrl="~/images/smallFail.gif"
                                            OnClientClick='<%# showApproval("unapproved",Eval("CustName").ToString(),Eval("SNo").ToString(),Eval("Status").ToString(),Eval("CustomerCode").ToString())  %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
Posted

1 solution

Hi,
Here Simple Example
public void Enabledisable()
{
   foreach (GridViewRow gr in gdvMappedQuestions.Rows)
    {
      ((LinkButton)gr.FindControl("IsAppovedByAcc")).Enabled = true;
      else
     ((LinkButton)gr.FindControl("IsAppovedByAcc")).Enabled = false;
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900