I'm trying to read a cell in a winform datagrid. I've tried using the
Current Row property to look back into the dataset, and that works... until
the datagrid is sorted, then the indexes no longer match.
Any ideas?
Thanks,
Jeff Foster
> I'm trying to read a cell in a winform datagrid. I've tried using the
> Current Row property to look back into the dataset, and that works...
until
> the datagrid is sorted, then the indexes no longer match.
You need to wrok with the binding manager - the grid is just a viewport over
a portion of the data.
BindingManagerBase bm =
(BindingManagerBase)grid.BindingContext[grid.DataSource, grid.DataMember];
DataRowView view = (DataRowView)bm.Current;
DataRow row = view.Row;
--
Mickey Williams
Author, "Microsoft Visual C# .NET", Microsoft Press
"Mickey Williams" <m...@codevtech.com> wrote in message
news:OJgpAnHoCHA.2408@TK2MSFTNGP11...