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


Thread ID:





51483 Nov 7,2006 06:04 AM UTC Nov 7,2006 01:19 PM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On November 7, 2006 06:04 AM UTC


What is the equivalent of Grid Control's property StopArrowKeyOnRow in Grid Data Bound Grid.


Administrator [Syncfusion]
Replied On November 7, 2006 08:39 AM UTC

Hi Bits,

Sorry for the inconvenience caused.

I couldn't see the StopArrowKeyOnRow property in a GridControl. I am really sorry to inform you that I am not clear about your question. Can you please give me a more details regarding this issue?

Do you want to customize the ArrowKey behavior in a grid? If so, you can handle the QueryNextCurrentCellPosition event and set the e.Handle to true to cancel it.

Below is a code snippet

//Cancel the all Arrow Key movement.
//If you want to cancel the Left & Right , you can check condition using the e.Direction.
private void gridQueryNextCurrentCellPosition(object sender, GridQueryNextCurrentCellPositionEventArgs e)
{ e.Handled = true; }

Refer to the forum thread below for more details.

Let me know if i am missing something.

Best Regards,

Administrator [Syncfusion]
Replied On November 7, 2006 12:32 PM UTC

Hi! Haneef,

OOPS! Sorry it was my mistake, we have a custom grid, which has this property. I thought somehow it belongs to Grid Control.

Yes, When I set WrapCellBehavior = GridWrapCellBehavior.WrapRow

I want only the Tab/Enter keys to move to the next row, while the Right Arrow key should remain/stop at the end of the enabled column and Left Arrow key should stop of the first enabled column.


Administrator [Syncfusion]
Replied On November 7, 2006 01:19 PM UTC


I found the solution. After loading the Grid.
I would find First Enabled Column and Last Enabled Column of the Grid using the below code
Me.mintFirstEnabledColumn = 0
For Each gbCol As GridBoundColumn In Me.GridDataBoundGrid1.Binder.InternalColumns
If gbCol.StyleInfo.Enabled Then
If Me.mintFirstEnabledColumn = 0 Then Me.mintFirstEnabledColumn = Me.GridDataBoundGrid1.NameToColIndex(gbCol.MappingName)
Me.mintLastEnabledColumn = Me.GridDataBoundGrid1.NameToColIndex(gbCol.MappingName)
End If

Then in CurrentCellKeyDown Event set the e.handled = True as below.

Private Sub GridDataBoundGrid1_CurrentCellKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridDataBoundGrid1.CurrentCellKeyDown

If e.KeyCode = Keys.Right AndAlso Me.GridDataBoundGrid1.CurrentCell.ColIndex = Me.mintLastEnabledColumn Then
e.Handled = True
ElseIf e.KeyCode = Keys.Left AndAlso Me.GridDataBoundGrid1.CurrentCell.ColIndex = Me.mintFirstEnabledColumn Then
e.Handled = True

End If
End Sub


It worked like a Charm!



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