To get the datakey on rowdatabound event for gridviews.
if (e.Row.RowType == DataControlRowType.DataRow)
{
string strY = GridView2.DataKeys[e.Row.RowIndex].Values[1].ToString();
}
The number 1 could be replaced with "KeyName" also.
Thursday, May 6, 2010
Subscribe to:
Posts (Atom)