D
Dave
I'm trying to understand when DataItem will be available to use as follows:
DataRowView rowData = (DataRowView)(e.Item.DataItem);
int someId = (int)(rowData["someId"]);
I found that e.Item.DataItem is available in DataGrid ItemDataBound such as
private void dgMyDataGrid_ItemDataBound(Object sender, DataGridItemEventArgs
e)
But not in Update method as in
private void dgCompanyCodes_Update(Object sender, DataGridCommandEventArgs e)
I guess I don't know why? Otherwise I have to use the following.
string myId= e.Item.Cells[0].Text;
DataRowView rowData = (DataRowView)(e.Item.DataItem);
int someId = (int)(rowData["someId"]);
I found that e.Item.DataItem is available in DataGrid ItemDataBound such as
private void dgMyDataGrid_ItemDataBound(Object sender, DataGridItemEventArgs
e)
But not in Update method as in
private void dgCompanyCodes_Update(Object sender, DataGridCommandEventArgs e)
I guess I don't know why? Otherwise I have to use the following.
string myId= e.Item.Cells[0].Text;