2 posts, 0 answers
  1. Kjell
    Kjell avatar
    225 posts
    Member since:
    May 2011

    Posted 06 Nov 2016 Link to this post

    I use Skin Bootstrap and RenderMode Lightweight

    Bootstrap use AlternatingItemStyle gray. I dont want to use that, i want have White for all items

    I try set <AlternatingItemStyle BackColor="#ffffff" /> Not works....

    <ItemStyle BackColor="#ffffff" /> works fine....

    BackColor="#ffffff" Not works....


    How to use White for all items in grid?



  2. Eyup
    Eyup avatar
    4046 posts

    Posted 10 Nov 2016 Link to this post

    Hello Kjell,

    Yes, this inconsistency is probably only for the Bootstrap skin. Generally, you can achieve this requirement using CSS by applying the background color to the individual cells:

    Alternatively, this approach should also work:
    Copy Code
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        if (e.Item is GridDataItem)
            GridDataItem item = (GridDataItem)e.Item;
            if (item.ItemIndex % 3 == 0) // custom condition
                foreach (TableCell cell in item.Cells)
                    cell.BackColor = System.Drawing.ColorTranslator.FromHtml("#b64949");

    But for bootstrap skin, instead of using dataItem.BackColor, set the color to the cells individually:
                foreach (TableCell cell in item.Cells)
                    cell.BackColor = System.Drawing.ColorTranslator.FromHtml("#b64949");

    I hope this will prove helpful.

    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top