Hi Ranjan,
Thank you for your interest in
Syncfusion products.
The GridControl is show the context menu, when the right
click has been performed in GridControl. The GridControl does not have default
property to show the context menu in editing mode. If you want the context menu
also in the editing mode, then please try using GridTextBoxRenderer class in GridControl to achieve this behavior.
Code:
private void Form1_Load(object sender,
EventArgs e)
{
this.gridControl1.ContextMenuStrip =
this.contextMenuStrip1;
GridTextBoxCellRenderer tr =
this.gridControl1.CellRenderers["TextBox"] as
GridTextBoxCellRenderer;
tr.TextBox.MouseUp += new
MouseEventHandler(TextBox_MouseUp);
}
void TextBox_MouseUp(object sender,
MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
Point pt =
GridUtil.CenterPoint(this.gridControl1.CurrentCellRenderer.GetCellClientRectangle(this.gridControl1.CurrentCell.RowIndex,
this.gridControl1.CurrentCell.ColIndex, GridStyleInfo.Default, false));
this.contextMenuStrip1.Show(this.gridControl1,
pt);
}
}
Please let us know if you have any
concern.
Regards,
Muthukumar K
Attachment:
ContextMenu_83095f9c.zip