开发者

How to get a column value in DeleteCommand of RadGrid event

How can I get the value of a specific column in a RadGrid on DeleteCommand event? I tried these ways, but they all return empty values:

GridDataItem da = e.Item as GridDataItem;
string name = da["materialName"].Text;

or

name = RadGrid1.Items[e.Item.ItemIndex]["materialName"].Text;

or

name =  RadGrid1.MasterTableView.Items[e.Item.开发者_JAVA技巧ItemIndex]["materialName"].Text;

or

name =  RadGrid1.MasterTableView.Items[e.Item.RowIndex]["materialName"].Text;


Label colTxt = (Label)e.Item.Cells[3].Text;

Label1.Text = colTxt.Text;

Try this. It worked for me.


say the column is 'ID'

GridDataItem item = (GridDataItem)e.Item; 
ID = Convert.ToInt32(item.GetDataKeyValue("ID")); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜