M
Marc Eggenberger
Hi there.
I have a small problem with DataGrid in ASP.NET & C#.
In the ItemDataBound Event I can use the following code
DataRowView drvSE = (DataRowView)e.Item.DataItem;
and then I can use
drvSE["ColumnName"].ToString();
to get the acutal data.
But in the Edit/Update/Delete Events this does not work.
The upper event has a DataGridItemEventArgs and the 3 commands where
it's not working have a DataGridCommandEventArgs.
They also have a e.Item.DataItem but its always null.
How should I do this here?
accessing the data with
e.Item.Cells[2].Text
works, but I dont want to hardcode the Columns position. How should I do
it?
I have a small problem with DataGrid in ASP.NET & C#.
In the ItemDataBound Event I can use the following code
DataRowView drvSE = (DataRowView)e.Item.DataItem;
and then I can use
drvSE["ColumnName"].ToString();
to get the acutal data.
But in the Edit/Update/Delete Events this does not work.
The upper event has a DataGridItemEventArgs and the 3 commands where
it's not working have a DataGridCommandEventArgs.
They also have a e.Item.DataItem but its always null.
How should I do this here?
accessing the data with
e.Item.Cells[2].Text
works, but I dont want to hardcode the Columns position. How should I do
it?