DataGrid EndEdit throws exception
From: GBayard (GBayard_at_discussions.microsoft.com)
Date: 11/18/04
- Next message: Kevin Yu [MSFT]: "Re: Update and re-Select when not using a stored procedure"
- Previous message: Kevin Yu [MSFT]: "Re: Expression column with nulls"
- Next in thread: GBayard: "RE: DataGrid EndEdit throws exception"
- Reply: GBayard: "RE: DataGrid EndEdit throws exception"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Nov 2004 00:27:02 -0800
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
- Next message: Kevin Yu [MSFT]: "Re: Update and re-Select when not using a stored procedure"
- Previous message: Kevin Yu [MSFT]: "Re: Expression column with nulls"
- Next in thread: GBayard: "RE: DataGrid EndEdit throws exception"
- Reply: GBayard: "RE: DataGrid EndEdit throws exception"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|