Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1020
How can I remove AltRowCssClass style?
posted

 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";

             }

}