When my app opens, I''d like to set focus to the first editable cell in the grid. I presume that CurrentCell.MoveTo is the appropriate method, but I don''t know how to identify the row/column of the first enabled cell.
ADAdministrator Syncfusion Team July 28, 2004 05:37 PM
Do you want to look through the row or down the column? You have some choices to consider.
You can always loop though cells checking grid[row,col].Enabled until your find one, and then use grid.CurrentCell.MoveTo to position that currentcell.
If you want to look across the first row, and you know the first row has at least one enabled cell, you can use code like this to find it without looping.
You can do the something similar looking down column 1.
But if you do not have information to know there is at least one enabled cell in a row or column, then I think you would have to loop through the rows and columns in the order you decide, looking for an enabled cell.
ADAdministrator Syncfusion Team July 28, 2004 08:48 PM
Indeed, the row and column of the first enabled cell varies frequently.
I was hoping there might be a better way than that (some usage or variation of QueryNextEnabledCell) that would do the trick.
Since I set the enabled attribute during the grid''s load logic, I just decided to save the location of the first enabled cell.