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

Is it possible to have a menu strip in radgrid of winforms

1 Answer 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
arnold
Top achievements
Rank 1
arnold asked on 18 Jan 2008, 01:25 AM
Hi,

Is it possible to insert a menu strip column inside radgridview as shown in the picture below? How? Thanks.

http://img186.imageshack.us/img186/5589/menustripradew9.png

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 18 Jan 2008, 11:47 AM
Hi arnold,

Thank you for this question.

Yes, you can insert a menu strip inside the RadGridView. This can be done inside the CellFormatting event.

Please refer to the following code snippet:

this.radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting); 
GridViewCommandColumn column = new GridViewCommandColumn(); 
column.HeaderText = "Action"
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) 
    if (e.CellElement is GridCommandCellElement) 
    { 
        if (e.CellElement.Children[0] is RadButtonElement ) 
        { 
            e.CellElement.Children.Clear(); 
            RadDropDownButtonElement buttonElement = new RadDropDownButtonElement(); 
            buttonElement.Items.Add(new RadMenuItem("Item 1")); 
            buttonElement.Items.Add(new RadMenuItem("Item 2")); 
            buttonElement.Items.Add(new RadMenuItem("Item 3")); 
            e.CellElement.Children.Add(buttonElement); 
            ThemeResolutionService.GetStyleSheetBuilder(buttonElement, "Office2007Silver").BuildStyle(buttonElement);                     
        } 
    } 
 

For more information take a look at the KB article shown below:
http://www.telerik.com/support/kb/article/b454K-mkb-b454T-cta-b454c-cta.aspx

Don't hesitate to write us if you have other questions.

All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
arnold
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or