how do I move the pre-built "Delete Row" option to the bottom or move my options to the top?
private void dgvSIQ_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
RadMenuItem mniProcess = new RadMenuItem();
RadMenuItem mniVendorInquiry = new RadMenuItem();
RadMenuSeparatorItem mniSeparate = new RadMenuSeparatorItem();
e.ContextMenu.Items[0].Visibility = ElementVisibility.Collapsed;
e.ContextMenu.Items[1].Visibility = ElementVisibility.Collapsed;
mniProcess.Text = "Process PO";
mniVendorInquiry.Text = "Vendor Inquiry";
//e.ContextMenu.Items.Add(mniSeparate);
e.ContextMenu.Items.Add(mniVendorInquiry);
e.ContextMenu.Items.Add(mniProcess);
try
{
mniProcess.Click += mniProcess_Click;
mniVendorInquiry.Click += mniVendorInquiry_Click;
}
catch (Exception)
{
}
}
Hi all,
I wish to open a DropDown list in a context menu when a user right click on a GridView cell and handle the click event on an element of this DropDown list.
I am a bit lost between the GridView context menu documentation and the one specific to general context menus
I tried using the RadMenuComboItem (as described in this document) but the result is no satisfactory.
Would someone have a simple example on how to do this ?
Many thanks
Patrick
The radgrid view has many different context menus it can show depending on what row you are on.
Header
Column Header
Column Filter Row (Contains, Begins With ....)
FilterRow (Type and highlights Yellow if found in Grid Results)
DataRow
private void gvResults_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
// How to tell which row I am in so I can change if needed the context menu?
}
// This is how I can tell if it is a Data Row
GridDataCellElement dataCell = e.ContextMenuProvider as GridDataCellElement;
if (dataCell == null)
return;
// What about the others?
//How can I tell (Column Header, Column Filter, Row Filter etc.)