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

e.CommandName = "" ... :(

1 Answer 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter From LA
Top achievements
Rank 1
Peter From LA asked on 10 Aug 2011, 08:08 PM
I have a RadGrid with GridButtonColumn as follows:
GridButtonColumn myCommandButton = new GridButtonColumn();
myCommandButton.ButtonType = GridButtonColumnType.PushButton;
myCommandButton.CommandName = "MyCommand";
myCommandButton.Text = "MyCommand";
myGrid.Columns.Add(myCommandButton);

but when the ItemCommand event fires, e=CommandName is an empty string...
What am I missing?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Aug 2011, 05:40 AM
Hello Peter,

I suppose this issue arises when you are creating RadGrid on Page_Load event, the columns or detail tables should be added to the corresponding collection first and then values for the properties of this instance should be set. When generating a grid in the Page_Init event handler, grid columns should be added to the Columns collection of the MasterTableView after their attributes are set. Check the following help documentation which explains more about this.
Programmatic Creation.

Thanks,
Princy.
Tags
Grid
Asked by
Peter From LA
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or