.net Janus Gridex, add multiple child rows, focus to the first row

594 Views Asked by At

In my table, I have 1 row, I add that, then I want to add a sub row in there(child table). When I add a second or third etc sub row, the focus always stays on the bottom row. If I add a new main row the focus always goes to the new main row not the bottom one like it does in the sub rows. I have tried all of the different setting that I can thing of but none will change the focus. Any help would be greatly appreciated.

Thanks

1

There are 1 best solutions below

0
Makesh On

You have to set the row position after adding each row

Try this one , may be it will help you :

grdTest.Row = (from R in grdTest.GetRows()
               where (int)R.Cells["PKeyColumnName"].Value == PKeyValue
               select R).FirstOrDefault().RowIndex;

Here "PKeyColumnName" is a unique column that you can take any column from your table

And "PKeyValue" is the value for the unique column (last added row )