Reputation: 13313
How can I get the index of the currently selected cell ? (index from the row containing it).
It would be logic if it had a property like this
myUltraGridView.ActiveCell.Index;
But it does not exists. I would like to avoid having to do something like this :
for (int i = 0; i < myUltraGridView.ActiveRow.Cells.Count; i++)
if(myUltraGridView.ActiveRow.Cells(i) == myUltraGridView.ActiveCell)
return i;
Any idea how I can access it ?
Upvotes: 0
Views: 1539
Reputation: 8982
There's also the Index
property on the UltraGridRow
class, if you're looking for the row's index.
ultraGrid1.ActiveCell.Row.Index
Upvotes: 1
Reputation: 43
Do you want the actual index or the visible index? Both of these come from the cell's column.
Try these:
(Actual)
myUltraGridView.ActiveCell.Column.Index
(Visible location in grid)
myUltraGridView.ActiveCell.Column.Header.VisiblePosition
Upvotes: 1