DataGrid.CurrentCell problem

  • Thread starter Thread starter Maxim
  • Start date Start date
M

Maxim

Hello, everybody!

I have a problem with DataGrid. I'm using CurentCell property to change text
of currently selected cell.
When the DataGrid contains no rows, CurrentCell still points to {0, 0} cell,
thus producing exception in my app. DataGrid class does not contain RowCount
property or something like that. So I need to get CurrencyManager to get
number of rows and then check CurrentCell to see if it points to real row.
Why CurrentCell is not {-1, -1} for empty grid?
Is there any work around?
 
perhaps .VisibleRowCount or .VisibleColumnCount will work for you? VRC will
be 0 when grid has no rows.
 
Back
Top