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

RadGrid_ItemCommand event not fired

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
LEE
Top achievements
Rank 1
LEE asked on 22 Oct 2010, 08:57 PM
After programamtically changing the expanded GridItem setting the property RadGridItem.Expanded to true, the RadGrid_ItemCommand event is not fired. It should be automatically fired since it should behave the same as expanding the item with a mouse click.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Oct 2010, 12:25 PM
Hello Lee,

One option is you can explicitly fire the ItemCommand using FireCommand(eventName,eventArgs) method .

C#:
RadGrid1.Items[0].Expanded = true;
GridDataItem dataItem = (GridDataItem)RadGrid1.Items[0];
dataItem.FireCommandEvent("ExpandCollapse", null); //will fire ItemCommandEvent

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
   {
      if (e.CommandName == "ExpandCollapse")
       {
       }
   }

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