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

Access GridCommandItem in codebehind

1 Answer 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 15 Dec 2011, 07:18 PM

 

Hi
I have a page with RadGrid on it and defined CommandItemTemplate with RadToolBar.
Toolbar has RadToolBarDropDown item. The problem is I need to add items to DropDownItem in code-behind.
Please advice how to do that.
Thanks
Vladimir

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2011, 05:22 AM
Hello Vladimir,

Try the following code snippet.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
  if (e.Item is GridCommandItem)
 {
   GridCommandItem item = (GridCommandItem)e.Item;
   RadToolBar tool = (RadToolBar)item.FindControl("RadToolBar1");
  }
}

-Shinu.
Tags
Grid
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or