As above, I have a WHDG on a page and in the InitializeRow event I check to see the credit rating for the customer displayed on that row and set the background row color accordingly.
Infragistics.WebUI.Shared.Style rowStyle = new Infragistics.WebUI.Shared.Style(); rowStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFA0"); e.Row.CssClass = Infragistics.Web.UI.Framework.AppSettings.AppStylingManager.CssRegistry.Add(rowStyle, "TBODY TR.{0} TD");
This all works correctly however I also have row selection enabled yet when you select the row the background color does not change to show the selection. I cannot find any attribute which would allow me to set the selected row color differently. Not sure if it is relevant but I have grouping enabled also.
Hello, what do you think for the suggested approach?
Hello cmdrew,
Thank you for contacting us!
About your question, my suggestion is to set a css class when activation behavior is invoked, by saying this I mean to set ActiveRowCssClass, in this way there is guarantee that some style will be applied on changing the row selection. As you can see from the attached sample I have custom row colors, and on selecting different rows, the "lightgreen" color is applied without issues.
Code snippet:
.......
I hope that you will find this sample helpful.