Hi,
I can assign ContextMenuStrip to a radGridView.
Now I have a Hierarchical Grid, what should i do if i want to assign ContextMenuStripA to master and ContextMenuStripB to detail?
1 Answer, 1 is accepted
0
Accepted
Dimitar
Telerik team
answered on 30 Jul 2013, 05:51 AM
Hi Chung-Yuan,
Thank you for writing.
Your question has already been answered in the other thread you've opened We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.
Hower I am copying the answer here so the community can benefit from it:
You can use the ContextMenuOpening event like this:
GridDataCellElement cell = e.ContextMenuProvider as GridDataCellElement;
GridViewRowInfo row = cell.RowInfo;
if (row.HasChildRows())
{
e.ContextMenu = firstContextMenu.DropDown;
}
else
{
e.ContextMenu = secondContextMenu.DropDown;
}
}
Also consider the following article where you can find complete information for how to display different context menus:Conditional Custom Context Menus
Thank you for your understanding.
Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely. Sign up for Free application insights >>