Gridview
-
Hi All, I develop a application with grid view. I have bind the values in gridview view (5 records). in Gridview, I want 4th row in red color and 5th row in green color. Plz help me. Thanks, Murugavel s
-
Hi All, I develop a application with grid view. I have bind the values in gridview view (5 records). in Gridview, I want 4th row in red color and 5th row in green color. Plz help me. Thanks, Murugavel s
You can do it on RowDataBound Event. Like This :
protected void Grd_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowIndex == 4)
{
e.Row.Style["Color"] = "Red";
}
else if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowIndex == 5)
{
e.Row.Style["Color"] = "Green";
}}
}
-
Hi All, I develop a application with grid view. I have bind the values in gridview view (5 records). in Gridview, I want 4th row in red color and 5th row in green color. Plz help me. Thanks, Murugavel s
Read about gridview event
RowDataBound
You get access to grid's row at the time of bind. Based on the need, you can set styles and make changes in row. Try out.Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Latest Post(s)]: My Blog Server side Delimiters in ASP.NET How to extend a WPF Textbox to Custom Picker