This is a migrated thread and some comments may be shown as answers.

AddNewRecordButton - CommandItem button accessing

1 Answer 18 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saimadhusudhan
Top achievements
Rank 1
Saimadhusudhan asked on 27 Oct 2015, 10:45 AM
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.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Oct 2015, 08:01 AM
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";
}

Regards,
Eyup
Telerik
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
Tags
General Discussions
Asked by
Saimadhusudhan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or