Skip to content

Replies

0
Martin
Martin answered on Apr 19, 2010 11:08 AM

        protected void WebDataGrid1_InitializeRow(object sender, RowEventArgs e)
        {
                    e.Row.Items[0].CssClass = "red";
                    e.Row.Items[1].CssClass = "green";
                    e.Row.Items[2].CssClass = "red";
                    e.Row.Items[3].CssClass = "green";

         }

You can set the color of individual columns by setting the CssClass of the items associated with the columns.

Martin

0
Martin
Martin answered on Apr 16, 2010 8:54 AM

Bhaskar and everyone reading this,

I have the same issue. I also would like to set the colors of a WebDataGrid on a Cell basis.

But I think or have the impression that it can only be done on a Column and/or Row basis. I hope I am not right 😉

Can an expert shed a light on this?

Thanks in advance.

Martin