im getting a error(object not set to an instance) when i try
((DataRowView) e.Item.DataItem).Row.ItemArray[8].ToString()
or
((System.Data.Common.DbDataRecord) e.Item.DataItem)[8].ToString()
in ItemCommand event of Datagrid
but the same statement works successfully in ItemDataBound of Datagrid
Why is it so? Am i doing any thing wrong?
((DataRowView) e.Item.DataItem).Row.ItemArray[8].ToString()
or
((System.Data.Common.DbDataRecord) e.Item.DataItem)[8].ToString()
in ItemCommand event of Datagrid
but the same statement works successfully in ItemDataBound of Datagrid
Why is it so? Am i doing any thing wrong?