Is there some documentation on how to change the row color when initializing the row?
I have tried to set the CSSClass but no luck.
The CSS is like this
.CustomRowColor {
background-color:yellow !important;
background-image:none !important;
}
Thanks.
Hello ,
To change the row color while initializing the row you can use OnInitializeRow event and assign your style class like this:
protected void WebDataGrid1_OnInitializeRow(object sender, RowEventArgs e) { e.Row.CssClass = "CustomRowColor"; }
I have created a sample application for your reference.
Please find the attached sample and let me know if you need further assistance.
This does not work!
See attached application.
Hello,
Try using below syntax while creating class and check if it change the behavior of the grid.
tbody> tr.CustomRowColor>td
{
if still you are not able to apply that class in the grid I would recommend you to open the development tool and see if 'CustomRowColor' class being apply to grid TR element or not.
( find the attached image file of the grid and development tool for your reference.)
Please let me know if you need further assistance on this matter.
None of this worked. Same results with either style.
See attached images the first is with original style and second is with new style.
I am wondering why nothing is working at your end.
Would like to know do you have ig_res folder in the sample?
I have downloaded your VB sample and modified the sample with the custom style, now I would like you to run the sample as it is without making any changes. Whether or not it works correctly may help indicate the nature of this problem.
Please note to reduce the size of the sample I have deleted Bin and ‘My project’ folder in your sample.
You just have to include the DLL reference in the sample and run it.
It appears I did not type the style information correctly as it is all working with the new style presented in the previous answer.
Now the question would be why did this not work with the original style that was provided by you?
Thank You.
Thank you for the update that your code is working now.
The original style was not working because in your sample you had empty ig_reg folder.
I did have the ig_res folder but this did not work until I changed the style information.
I have since got this new style to work in a working project that has styling fully enabled where the original style format did not work.
Thanks