Hi Qingde,
Thank you for your interest in Syncfusion products.
If you want to show the context menu in GridControl while current cell editing
mode, then please try to using the TextBox.MouseDown event in
GridTextBoxCellRenderer to achieve this functionality as shown below.
Code:
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 me know if you have any concern.
Regards,
Muthukumar K