in the OnItemDataBound event handler, sometimes you want to access the datasource of a control. whether the datasource is a object, or just a field of a dataset, you can always access it using following code:
DataRowView drv = (DataRowView)e.Item.DataItem;
//then access the specific field
string str = drv["fieldname"].ToString();
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment