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

             }

}

Parents
No Data
Reply
  • 29417
    Offline posted

    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:

    . igg_RedRow

    {

    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

     

Children