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

Disable context menu

1 Answer 191 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Arthur
Top achievements
Rank 1
Arthur asked on 22 Apr 2013, 10:20 AM
Hi,

I have a context menu used to add and remove rows. I also have the InsertRow present.

I would like to know if its possible to disable the context menu when the user has used the InsertRow and has focused on the new row

Thanks

Arthur

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 24 Apr 2013, 07:25 AM
Hi Arthur,

In order to achieve your goal you can handle Opening event of RadContextMenu and execute the following code:

private void RadContextMenu_Opening(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadContextMenu menu = (RadContextMenu)sender;
            GridViewNewRow row = menu.GetClickedElement<GridViewNewRow>();
            if (row != null || this.clubsGrid.RowInEditMode !=null)
            {
                e.Handled = true;
            }
        }

I hope this helps.

All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Arthur
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or