Thursday, February 17, 2011

How to read the binding data record of the current row in Asp.Net GridView


You can get the binding data record using following code example:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string name= DataBinder.Eval(e.Row.DataItem, "StudentName") as string;
if (name!= null && name.Length > 0)
{

}
}
}

No comments: