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

How to focus to child table row using tab key

Hi,
Question1:
I want to focus  child table row using tab key.
Question2:
If I have rowindex of child table then How to focus particular cell of that rowindex.
Is any solution regarding this?

Regards,
Paurnima.


1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team January 1, 2015 02:25 PM UTC

Hi Paurnima,

 

Sorry for the delay in response.

 

If you want to focus the child table row  using the tab key and also focus the particular cell of row index in a grid, you can use the “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_TableControlKeyDown(object sender, GridTableControlKeyEventArgs e)

 {

   GridCurrentCell cc = e.TableControl.CurrentCell;

   GridTable tablechild = this.gridGroupingControl1.GetTable("Orders");

   if (tablechild.CurrentRecord != null)

    {

     if (e.Inner.KeyCode == Keys.Tab)

      {

         e.TableControl.CurrentCell.MoveTo(GridRangeInfo.Cell(cc.RowIndex + 1, 1), GridSetCurrentCellOptions.SetFocus); // focus to next row in child table

      }

    }

   MessageBox.Show("Table RowIndex : " + tablechild.CurrentRecord.GetRowIndex());

   e.Inner.Handled = true;

 }

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K



Attachment: Focus_particular_cell__Tab_key_e5a37b63.zip

Loader.
Live Chat Icon For mobile
Up arrow icon