protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
// check we are dealing with a data row
if (e.Row.RowType == DataControlRowType.DataRow)
{
// retrieve the data associated with the row
System.Data.DataRowView row = e.Row.DataItem as System.Data.DataRowView;
if (row != null)
{
// check the value of the second field
if (row[1].ToString() == "Wibble")
{
// we don't like it so change the value displayed to something else
e.Row.Cells[1].Text = "Something Else";
}
}
}
}
|