How do I get back to ImageButton properties within the ItemCommand event?

2 posts, 0 answers
  1. Henry
    Henry avatar
    14 posts
    Member since:
    Dec 2008

    Posted 16 Apr 2014 Link to this post

    Hi,

    How do I get back to ImageButton properties within the ItemCommand event? I need to change the ImageURL once I have done my other database calls.

    Regards,

    Henry Fourie
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 16 Apr 2014 in reply to Henry Link to this post

    Hello,

    protected void grid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if(e.CommandName == "YourCommandName")
        {
            GridDataItem item = e.Item as GridDataItem;
            (item["Your-imagecolumn-uniqueName"].Controls[0] as ImageButton).ImageURL = "Your new image URL comes here";
        }  
    }

    After assigning the imageURL if you rebind your Grid then it set the old image URL.
    If you set the ImageURL based on your Data then it will creates any issue after rebinding Radgrid.

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top