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

using ENTER key on a caption row

Thread ID:





50157 Oct 6,2006 03:55 PM UTC Oct 10,2006 11:07 AM UTC WinForms 3
Tags: Grouping
Eric Weber
Asked On October 6, 2006 03:55 PM UTC


I have created an editable cell in a GroupCaptionSummaryCell row. After the user types in a value and hits the ENTER key, the caption row expands/collapses. Is there anyway to disable the expand/collapse behavior when hitting the ENTER key?



Administrator [Syncfusion]
Replied On October 9, 2006 04:48 AM UTC

Hi Eric,

Try this code to handle the Enter Key behavior in a grid.

//Main Table in a grid
this.gridGroupingControl1.TableControl.WantEnterKey = false;

//Any tablecontrol in a Grid.
this.grid.GetTableControl("TableName").WantEnterKey = false;

Let me know if this helps.

Best Regards,

Eric Weber
Replied On October 9, 2006 06:57 PM UTC

I added this code, and it certainly does disable the ENTER button.

Now, after I type a value into the cell and hit the ENTER button, nothing happens. I tried catching the event in the TableControlKeyUp event, but it didn''t fire.

Prior to adding the WantEnterKey code, the enter key was firing the TableControlCurrentCellValidated event, and this is where I had my validation/rollback code.

Any suggestions?



Administrator [Syncfusion]
Replied On October 10, 2006 11:07 AM UTC

Hi Eric,

You can use the TableControlCurrentCellControlKeyMessage event to detect the Enter Key when the currentcell is in EditingMode. Here is a code snippet

//Form load...
this.grid.TableControlCurrentCellControlKeyMessage +=new GridTableControlCurrentCellControlKeyMessageEventHandler(gridControlKeyMessage);

private void gridControlKeyMessage(object sender, GridTableControlCurrentCellControlKeyMessageEventArgs e)
Keys keyCode = (Keys)((int)e.Inner.Msg.WParam) & Keys.KeyCode;
if(keyCode == Keys.Enter )
Console.WriteLine("Enter Key pressed");

This event is called from current cell control''''s ProcessKeyMessage method and gives you a chance to modify the default behavior of this method. Be aware that this a very implementation-specific method and you should only handle this event if KeyDown,KeyUp,CurrentCellKeyDown or CurrentCellKeyUP events are not good enough.

Best Regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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