We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

RIGHT Click cut/paste popup behavior in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

43521 Apr 25,2006 12:51 PM UTC Apr 26,2006 04:53 PM UTC WinForms 2
loading
Tags: GridControl
Brian
Asked On April 25, 2006 12:51 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;