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
close icon

Tabbinb to next chidl row

Using a GridGroupingControl, when I'm on the last cell on a row and I hit TAB key, I want the focus to go into its child rows on the first column (expand the row and focus the first cell inside).

The WrapCellBehavior does not do anything.
I'm looking at OnTableControlCurrentCellKeyDown to redirect the focus to the proper row/col, but I can't find how to do it.
I need help on this.

Thanks


1 Reply

RC Rajadurai C Syncfusion Team November 5, 2008 09:53 AM UTC

Hi Patrick,

Thanks for your interest in Syncfusion products.

Apologies for the delay.

This feature can be achieved by means of TableControlMoveCurrentCellDirection event handler in GridGroupingControl.

Here is the codesnippet,


private void gridGroupingControl1_TableControlMoveCurrentCellDirection(object sender,GridTableControlMoveCurrentCellDirectionEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
int lastPos = style.TableCellIdentity.Table.TableDescriptor.VisibleColumns.Count - 1;
string lastName = style.TableCellIdentity.Table.TableDescriptor.VisibleColumns[lastPos].Name;
if(style.TableCellIdentity.Column.MappingName == lastName && e.Inner.Direction == GridDirectionType.Right)
{
Element el = style.TableCellIdentity.DisplayElement;
if(el != null)
{
GridRecord rec = el.ParentRecord as GridRecord;
int index = style.TableCellIdentity.Table.FilteredRecords.IndexOf(rec);
if(index < style.TableCellIdentity.Table.FilteredRecords.Count - 1)
{
rec = style.TableCellIdentity.Table.FilteredRecords[index + 1] as GridRecord;
rec.SetCurrent(style.TableCellIdentity.Table.TableDescriptor.VisibleColumns[0].Name);
e.Inner.Handled = true;
e.Inner.Result = true;
}
}
}
}


Please refer the following sample.
http://websamples.syncfusion.com//samples/Grid.Windows/F77421/main.htm

Please let me know if this helps.

Regards,
Rajadurai







Loader.
Live Chat Icon For mobile
Up arrow icon