Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
769
How to change colour of the RowStyleDefault in the webgrid
posted

Hello all,

 I have an ultrawebgrid with many rows and many columns. By default, I don't specify a colour for either odd or even rows. I just display it normally, the only time I would show/display a colour (to differentiate that row) depending on the value in a certain column on that row. For example, on row five, col3, if the value for col3 is >10, I would apply a colour to this row.

In my code I have the following line of code and have read about RowStyleDefault examples and I've tried them all but none works for me.

Inside my ultrawebgrid1_InitializeRow(...){

 ultrawebgrid1.DisplayLayout.RowStyleDefault.CssClass = "RowStyleSpecial";

}

stylesheet.css

.RowStyleSpecial

 border-width:1px;

border-color:Black;

border-style:solid;

color:Red;

}

In the place of color:Red; I have tried to used background-color:Red - but still it doesn't work.

 I don't know what else I need to do in order for a certain row to show the colour using the stylesheet style - RowStyleSpecial

If anyone has any suggestions or examples, could I please get the sample.

Thanks alot in advance!

HS2