Hi all,
when we're binding a Collection of a Business Object into the Grid, the grid.DataItem should be that type, right?
I'm getting null :(
Code:
| List<DocumentRow> rows = new List<DocumentRow>(); |
| ... |
| while (reader.Read()) |
| { |
| DocumentRow row = DocumentRow.GetFromIdxDocumentId(int.Parse(reader[0].ToString())); |
| rows.Add(row); |
| } |
| ... |
| gvDocs.DataSource = rows; |
| gvDocs.DataBind(); |
when trying to get the selected items...
| foreach (GridItem gvr in gvDocs.SelectedItems) |
| { |
| DocumentRow row = (DocumentRow)gvr.DataItem; |
| list.Add(row.DocumentId); |
| } |
gvr.DataItem is always null! :-(
how do I get the data back?