Hi Supriya,
Thank you for your interest in Syncfusion products.
If you want to set focus to next row of parent table as well
as child table while pressing down arrow key in gridgroupingcontrol, you can
use “TableControlKeyDown” event and focus particular cell by
using “MoveTo()”method and set the “GridSetCurrentCellOptions” as SetFocus.
Please refer the below code,
Code:
this.gridGroupingControl1.TableControlKeyDown += new GridTableControlKeyEventHandler(gridGroupingControl1_TableControlKeyDown);
void
gridGroupingControl1_TableControlCurrentCellKeyDown(object
sender, GridTableControlKeyEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTable tablechild = this.gridGroupingControl1.GetTable("MyChildTable");
GridTableCellStyleInfo style =
tablechild.GetTableCellStyle(cc.RowIndex, cc.ColIndex);
if (e.Inner.KeyCode == Keys.Down)
// pressing
Down arrow key
{
if (tablechild.CurrentRecord != null) // child table
{
e.TableControl.CurrentCell.MoveTo(GridRangeInfo.Cell(cc.RowIndex + 1, cc.ColIndex), GridSetCurrentCellOptions.SetFocus);
}
else // parent
table
{
e.TableControl.CurrentCell.MoveTo(GridRangeInfo.Cell(cc.RowIndex + 1, cc.ColIndex), GridSetCurrentCellOptions.SetFocus);
}
e.Inner.Handled = true;
}
}
Please let us know if you have any
concern.
Regards,
Muthukumar K
Attachment:
Related_Master_Details_Demo_c373e530.zip