G
Guest
Hello.
For simplicity sake, I wanted to use a dataset as my business object, but
because I needed to implement a lot of business logic, I've just derived my
classes from the typed dataset (and datatable and datarow using ADO.NET
Dataset builder by Shawn Wildermuth).
Everything works great, but after binding my objects to a datagrid, I need
to change some small things for each row in the grid, so I'm implementing
Datagrid's OnItemCommand delegate which returns me DataItem inside the
e.Item.
The thing is, for some unknown to me reason, the DataItem is of type
DataRowView, and I can't cast it neither to my object nor to DataRow.
What can I do? How can I get the original object it was bound (at least I
think it was) to?
Thanks in advance.
For simplicity sake, I wanted to use a dataset as my business object, but
because I needed to implement a lot of business logic, I've just derived my
classes from the typed dataset (and datatable and datarow using ADO.NET
Dataset builder by Shawn Wildermuth).
Everything works great, but after binding my objects to a datagrid, I need
to change some small things for each row in the grid, so I'm implementing
Datagrid's OnItemCommand delegate which returns me DataItem inside the
e.Item.
The thing is, for some unknown to me reason, the DataItem is of type
DataRowView, and I can't cast it neither to my object nor to DataRow.
What can I do? How can I get the original object it was bound (at least I
think it was) to?
Thanks in advance.