Enable the Image Button in gridview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sagarkandekar
    New Member
    • Apr 2008
    • 2

    Enable the Image Button in gridview

    Hi,
    I want to enable the Button after clicking the another button in the gridview.

    Here is my code:

    <asp:TemplateFi eld>
    <ItemTemplate >
    <asp:LinkButt on ID="Comment" Text ="Comment" CommandName ="comment" runat =server ></asp:LinkButton>
    <asp:ImageButto n ID="upload" ImageUrl="../images/btnUploadfiles. gif" runat =server commandname="Up load" Enabled =false />
    </ItemTemplate>
    </asp:TemplateFie ld>

    I want to "Enabled =True" after clicking the Comment link button.
    please help me.

    Sagar.
  • sagarkandekar
    New Member
    • Apr 2008
    • 2

    #2
    protected void GridView1_RowCo mmand(object sender, GridViewCommand EventArgs e)
    {
    if (e.CommandName. Equals("comment "))
    {
    LinkButton Comment = e.CommandSource as LinkButton;
    GridViewRow gvr = Comment.NamingC ontainer as GridViewRow;
    ImageButton upload = gvr.FindControl ("upload") as ImageButton;
    upload.Enabled = true;
    }
    }

    Comment

    Working...