Context:
version : 2013.2.2028
One page with WebDataGrid.
StyleName => Rubberblack
What I want to achieve:
Based on one column value, I want to put a row in a specific color to help the user find its information as fast as possible.
I've tried : http://www.infragistics.com/community/forums/p/63030/319707.aspx#319707
But, doesn't seems to work (maybe due to style set to rubberblack).
so the question is simple:
What should I do to make it works ?
What even do I have to handle ? what piece of code to fix this ?
Thanks
Hello Nicolas,
Due to the classname prefixes applied for the RubberBalck styleset, the style definition in this scenario should reflect this:
<style type="text/css"> tbody.igg_RubberBlackItem >tr>td.customStyleEven { background-color:Red ; } tbody>tr.igg_RubberBlackAlt>td.customStyleOdd { background-color:Blue; } </style>
Please also note that the tbody.igg_RubberBlackItem > tr > td class (item class) applied by the RubberBlack styleset has a definition for a background-image which will be displayed on top of the background color. Therefore in this scenario you may wish to manually edit this class in order to remove the background image definition.
Hope this helps. Please feel free to contact me if with any questions.
it helps but not totally solve the problem...
Here the code I have:
protected void WebDataGrid1_InitializeRow(object sender, RowEventArgs e) { if (e.Row.Items[2].Value.ToString() == "Crée") { foreach (GridRecordItem item in e.Row.Items) { if (item != null) { item.CssClass = "customStyleEven"; } }
and style:
tbody.igg_RubberBlackItem >tr>td.customStyleEven { background-color:Red ; } tbody>tr.igg_RubberBlackAlt>td.customStyleOdd { background-color:Blue; }
My question: What should I do to avoid some lines aren't well colored ?
Question 2: Is it possible to apply a style on a row instead of each item of the row ? is so, how ?
I'm sure you will propose an answer as fast as you will read this :)
Thank you for your replies.
Styling a row can be achieved by using a class selector similar to:
tbody.igg_RubberBlackItem >tr.CustomRowStyle>td { background-color:Red ; }
Note that for some attributes, !important may need to be applied as the usual hierarchy of applying css rules may be ignored (which should be used with caution). The row class can then be set at InitializeRow using:
e.Row.CssClass = "CustomRowStyle";
Regarding the issues in the image shown, I am not completely sure why one of the columns is being skipped while styling. Can you provide me with some additional information whether there are some special settings applied on the Cree column ?
Do not hesitate to contact e with any updates or questions.
Well, it's always the same
The style is set to rubberblack and nothing else is done except in the code provided...
Thank you for your reply.
In order to allow me to examine this further, is it possible for you to share a sample illustrating the issue ? Inspecting whether unexpected CSS rules are applied on the particular column's cells through the developer tools may also help in revealing issues.
Please do not hesitate to contact me with any updates or questions.