G
Guest
I have a DataGrid loaded from a Database. The app works great until I add
code to save the cell the user is editing. I've broken up the code for easy
reading as follows:
int col = dataGrid.CurrentCell.ColumnNumber;
int row = dataGrid.CurrentCell.RowNumber;
// exception here:
DataGridColumnStyle dgc = dataGrid.TableStyles[0].GridColumnStyles[col];
catalogGrid.EndEdit(dgc, row, false);
The line bellow the comment throws a 'System.ArgumentOutOfRangeException'.
The datagrid is created before this code is called. The exception is thrown
by the TableStyles collection, not the GridColumnStyles. Somehow 0 is out of
range for the table styles, I don't get it... I will try some work arounds
but if anyone has any ideas, let me know.
Thanks,
Greg
code to save the cell the user is editing. I've broken up the code for easy
reading as follows:
int col = dataGrid.CurrentCell.ColumnNumber;
int row = dataGrid.CurrentCell.RowNumber;
// exception here:
DataGridColumnStyle dgc = dataGrid.TableStyles[0].GridColumnStyles[col];
catalogGrid.EndEdit(dgc, row, false);
The line bellow the comment throws a 'System.ArgumentOutOfRangeException'.
The datagrid is created before this code is called. The exception is thrown
by the TableStyles collection, not the GridColumnStyles. Somehow 0 is out of
range for the table styles, I don't get it... I will try some work arounds
but if anyone has any ideas, let me know.
Thanks,
Greg