Hi,
I have tried to apply different css classes for UltraWebGrid Header,OddRows and EvenRows.
Following is the code used :
UltraWebGrid1.DisplayLayout.HeaderStyleDefault.CssClass = "cssHeader";
UltraWebGrid1.DisplayLayout.RowStyleDefault.CssClass = "cssOddRow";
UltraWbGrid1.DisplayLayout.RowAlternateStyleDefault.CssClass = "cssEvenRow";
It works for header but for rows it takes by default "cssOddRow" class for all row.
If you comment the cssOddRow line then it takes cssHeader class for Header as well as OddRow.it works fine for even row in this case.
Any Idea ?
Thanks,
Raju
Thanks mateia !!! It's working now.
In my code problem is order of .css class style and .cs apply order.
For any one else, order should be always like following -
.cs
this.UltraWebGrid1.DisplayLayout.RowStyleDefault.CssClass = "RowStyle";this.UltraWebGrid1.DisplayLayout.RowAlternateStyleDefault.CssClass = "RowAltStyle";this.UltraWebGrid1.DisplayLayout.HeaderStyleDefault.CssClass = "HeaderStyle";
this
and in .css
.RowStyle{background-color:Blue;}.RowAltStyle{background-color:White;}.HeaderStyle{background-color:Green;}
RowStyle
background-color
Blue
RowAltStyle
White
HeaderStyle
Green
Hello,
1. Could you tell us in what order are the Row, AlternateRow and Header styles in your .css file ?
2. Maybe these articles will help you
http://forums.archive.infragistics.com/readmessage?id=%3C6a29922e$54d9aac9$5caf8@news.infragistics.com%3E&group=infragistics.products.netadvantage.aspnet.webgrid#%3C6a29922e$54d9aac9$5caf8@news.infragistics.com%3E
http://forums.archive.infragistics.com/readmessage?id=%3C4fe416f$59b393f2$c6bd9@news.infragistics.com%3E&group=infragistics.products.netadvantage.aspnet.webgrid#%3C4fe416f$59b393f2$c6bd9@news.infragistics.com%3E
Hey Guys,
I have found an alternate ways but not sure whether I am correct or not ...
I have commented the below line
and added the following
UltraWebGrid1.DisplayLayout.FrameStyle.CssClass = "cssOddRow";
Now it applies Header style, Alternate row style correctly and for rest of the frame it will take cssOddRow style.
But I am not sure whether it's a correct way ....
Thanks shareeef !!!
Setting OptimizeCSSClassNamesOutput property to false prevents odd rows to take header style.This code resolves my 50% problem.
But Issues are still there. I have to apply different CSS for odd and even row. Following is the code :
The above code by default take cssOddRow style for all rows.
Any solution ?
Raju,
Read this article. http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=10101
Using the following solved some of our issues:
protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e){ e.Layout.OptimizeCSSClassNamesOutput = Infragistics.WebUI.Shared.DefaultableBoolean.False;}