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

How to differentiate the context menus

1 Answer 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Arunkumar Dharuman
Top achievements
Rank 1
Arunkumar Dharuman asked on 04 Mar 2011, 08:12 AM
Hi All,
I'm working on customizing certain menu items available on Filter ContextMenu. For that I'm handling ContextMenuOpening event. 
This event is generated for all context menus like, Header context menu, Data row context menu and Filter row funnel-button context menu. I wanted to differentiate among these Context Menus and handle only Filter row funnel-button context menu.

Actually one thing I observed was on ContextMenuProvider. It varies like HeaderCellElement, DataCellElement and for funnel-button it is null. Is it a right object to differentiate the context menus or is there any other options available? Please help me out.

Thanks and Regards
ArunDhaJ

1 Answer, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 04 Mar 2011, 10:19 AM
Hello,

In the ContextMenuOpening event, you can tell if it is a Filter Context Menu opening because the ContextMenuProvider will be null.
I'e

private void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    if (e.ContextMenuProvider == null)
    {
        MessageBox.Show("This is the filter menu");
    }
}

Hope that helps
Richard
Tags
GridView
Asked by
Arunkumar Dharuman
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or