I do not want to use AltRowCssClass style. But I want to set row color accroding to different data value.
I find AltRowCssClass style overrider CssClass style. Following is my code:
protected void WebDataGrid_PreRender(object sender, EventArgs e)
{
WebDataGrid grid = sender as WebDataGrid;
for (int i = 0; i < grid.Rows.Count; i++)
if (grid.Rows[i].Items.FindItemByKey("CHECKED_FLAG").Text == "False")
grid.Rows[i].Items.FindItemByKey("DESCRIPTION").CssClass = "igg_RedRow";
else
grid.Rows[i].Items.FindItemByKey("DESCRIPTION").CssClass = "igg_WhiteRow";
}
Hello foxbabby ,
Thank you for posting in our forum.
You have a few options here:
1) For your custom styles set to the settings that get overridden the !important tag. For example if the style is:
. igg_RedRow
background-color: red;
Modify it like this:
background-color:red !important;
And that style will overwrite the default one.
2) Find the AltRow style in the style folder you’re using –ig_res/YourStyle and remove it.
Let me know if you have any questions or concerns.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
I just want to remove AltRow style in one web page。So I can not remove it from ig_res/。。。
The first method have some bug : If I changed AltRow style through this method ,I find all the even row has changed. I just want to set row style dynamic. Row style may be different with each other.