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. Image for the cookie policy date

Tab Order Thru Grids

Is there a bug in the grid control when tabbing out of a griddatabaoundgrid after setting:

GridPhone.Model.Options.WrapCellBehavior = GridWrapCellBehavior.NextControlInForm ??

What I am finding is that if the next tab order after attempting to tab out of a grid is a textbox (in this case) in a container object (in this case a groupbox), the next control focus is set to is the next object not in any container. In other words, it appears the next tab order is a control not in a container.

If there is no solution, can I harness a tab event from a grid's rightmost column to force fucus to a specific textbox or like control?

I am coding this in VB.

Thanks,

Tom

3 Replies

AD Administrator Syncfusion Team March 5, 2007 10:34 PM UTC

Hi Tom,

One way you can do this by override the ProcessCmdKey method of the form and set the focus to GroupBox container control. Here is a code snippet.

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (this.gridControl1.ContainsFocus && keyData == Keys.Tab)
{
this.GroupBox.Focus();
return true;
}
return base.ProcessCmdKey (ref msg, keyData);
}

Best regards,
Haneef


TA Tom Affholter March 6, 2007 05:30 PM UTC

I am not coding C#. Is this done in the grid's keypress event? Could you translate.

Thanks much!


AD Administrator Syncfusion Team March 6, 2007 10:21 PM UTC

Hi Tom,

You can manage this issue by handling the CurrentCellKeyDown event of the grid and set the focus to another control. Here is a code snippet

Private Sub GridControl1_CurrentCellKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles GridControl1.CurrentCellKeyDown
If e.KeyData = Keys.Tab Then
Me.GroupBox1.Focus()
e.Handled = True
End If
End Sub

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon