protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.DataItem != null) { DataRowView drv = (DataRowView)e.Row.DataItem; string catName = Convert.ToString(drv["CategoryName"]); if (catName.Trim() == "Confections") e.Row.BackColor = System.Drawing.Color.LightBlue; } }
DataRowView drv = (DataRowView)e.Row.DataItem;
GridView.RowDataBound
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)