AddNewRecordButton - CommandItem button accessing

2 posts, 0 answers
  1. Saimadhusudhan
    Saimadhusudhan avatar
    2 posts
    Member since:
    Jul 2015

    Posted 27 Oct 2015 Link to this post

    When I try to execute the line of code 

    RadGridUserTypeWorkflows.MasterTableView.CommandItemSettings.AddNewRecordImageUrl = 

    "~/App_Themes/" + Page.Theme + "/Grid/AddRecord_na.gif"; to change the image of the 

    "AddNewRecordButton" Command Item button  in a Radgrid , it doesn't change the Image.
    Also after executing the above line of code and if we try to access this control 
    using the following code
    Button imgAddNewRecord = (Button)e.Item.FindControl("AddNewRecordButton");
    in the ItemCreated event of the grid it returns null. 

    But if I execute the commands in the follwing manner it return the control but the image 

    icon is not changed.

    Button imgAddNewRecord = (Button)e.Item.FindControl("AddNewRecordButton");
    RadGridUserTypeWorkflows.MasterTableView.CommandItemSettings.AddNewRecordImageUrl = 

    "~/App_Themes/" + Page.Theme + "/Grid/AddRecord_na.gif";

    How do we change the Image of the "AddNewRecordButton" programatically and disable the 

    same control.
  2. Eyup
    Eyup avatar
    2941 posts

    Posted 30 Oct 2015 Link to this post

    Hello Saimadhusudhan,

    Try using the following event handler and let me know about the result:
    protected void RadGrid1_DataBinding(object sender, EventArgs e)
        RadGrid1.MasterTableView.CommandItemSettings.AddNewRecordImageUrl = "~/arrowUp.png";

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top