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

when I press down arrow key in current cell of row then how to set focus to cell of next row in parent table as well as child table

Thread ID:

Created:

Updated:

Platform:

Replies:

117914 Jan 8,2015 10:46 AM UTC Jan 11,2015 03:38 PM UTC WinForms 1
loading
Tags: GridGroupingControl
Supriya Varne
Asked On January 8, 2015 10:46 AM UTC

Hi,
I am using Gridgrouping control.
I have Parent-Child Relationship in the control.
I want to change values in cell of  rows values in child table.
when  I press down arrow key in current cell of row then   how to set focus  to cell of next row in parent table as well as child table
Please give me solution regarding to this.

Thank you and Regards,
Supriya

Muthukumar Kalyanasundaram [Syncfusion]
Replied On January 11, 2015 03:38 PM UTC

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

CONFIRMATION

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.

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

;