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
hs2 said:this.Ultrawebgrid1.Row.Style.CssClass = "wgStyle";
You might try looking at what your browser's "View Source" command shows you to see if your CssClass is even making it to the browser.
Then again, it may turn out that you have to do it in VB. <grin>
Hi there!!!
C# is da best!! j/k. To each their own!
Thanks for the reply! Is there a way to put the BackColor into a CssClass and call
this.Ultrawebgrid1.Row.Style.CssClass = "wgStyle";
I tried this and as you know the .css doesn't have the BackColor property so I thought using the Background-color:Blue; would work but it doesn't understand it. I tried using Color:Blue; then only the actual values on the row is blue but not the BackColor/Background-color of the row.
If you or anyone who knows how to set the BackColor/Background-color in a .css file and then pass in the style name that would be greatly appreciated!
Best Regards,
hs2 said:ultrawebgrid1.DisplayLayout.RowStyleDefault.CssClass = "RowStyleSpecial";
The .RowStyleDefault property specifies the default for all rows in a band. You need to set the .Style property of the row in question: (please forgive the VB -- I pretend I don't talk to C# programmers. ;-)
Me.UltraWebGrid1.Rows(0).Style.BackColor = Color.BlueMe.UltraWebGrid1.Rows(1).Style.ForeColor = Color.Red