The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I would like to duplicate the right click behavior that a TextBox has, in a GridControl. So when I right click in a cell I get the "Undo Cut Copy Paste..." PopUp menu. Thanks
ADAdministrator Syncfusion Team April 26, 2006 04:46 AM UTC
Hi Brian
The standard context menu of a TextBox can be achieved in a GridControl by setting the CellType to OriginalTextBox. Also the CurrentCellControlGotFocus event must be handled and there null must be set to the control’s ContextMenu to make sure that any other/empty context menu would not take the precedence over the default TextBox context menu. Below is a code snippet. Let us know if you need any further assistance.
this.gridControl1.CurrentCellControlGotFocus += new System.Windows.Forms.ControlEventHandler(this.gridControl1_CurrentCellControlGotFocus); //Add Event Handler
this.gridControl1.TableStyle.CellType = "OriginalTextBox"; //Set cell type
private void gridControl1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e)
{
e.Control.ContextMenu = null;
}
Regards,
Calvin.
ADAdministrator Syncfusion Team April 26, 2006 04:53 PM UTC
Calvin,
This works great!
Thanks
>Hi Brian
>
>The standard context menu of a TextBox can be achieved in a GridControl by setting the CellType to OriginalTextBox. Also the CurrentCellControlGotFocus event must be handled and there null must be set to the control’s ContextMenu to make sure that any other/empty context menu would not take the precedence over the default TextBox context menu. Below is a code snippet. Let us know if you need any further assistance.
>
>this.gridControl1.CurrentCellControlGotFocus += new System.Windows.Forms.ControlEventHandler(this.gridControl1_CurrentCellControlGotFocus); //Add Event Handler
>
>this.gridControl1.TableStyle.CellType = "OriginalTextBox"; //Set cell type
>
>
>private void gridControl1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e)
> {
> e.Control.ContextMenu = null;
> }
>
>
>Regards,
>Calvin.