Background Color for GridView

5 posts, 0 answers
  1. John
    John avatar
    8 posts
    Member since:
    Dec 2017

    Posted 19 Dec 2017 Link to this post

    Something so simply yet Telerik seems so un-intuitive.

    I want a buttonface background color, but the cells I want white. It seems when I set the background color, it then colors the cells also. That to me seems very un-intuitive. Putting my gripe aside, any idea how to achieve this simply issue?

     

  2. Dimitar
    Admin
    Dimitar avatar
    2598 posts

    Posted 20 Dec 2017 Link to this post

    Hi John,

    By default, the cells' background is not painted. What you need to do is use the CellFormatting event and set the back color of the cells as well. An example of this is available here: Formatting Cells.

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. John
    John avatar
    14 posts
    Member since:
    Nov 2017

    Posted 20 Dec 2017 in reply to Dimitar Link to this post

    Hi Dimitar,

    Still doesn't work, I tried every example your link had and to no avail. What your example did was colorize the cell only if I clicked in it. That is not what I described in my question.

  4. John
    John avatar
    14 posts
    Member since:
    Nov 2017

    Posted 20 Dec 2017 Link to this post

    I got it working, I had to also finagle with the gradient to fill
  5. Dimitar
    Admin
    Dimitar avatar
    2598 posts

    Posted 21 Dec 2017 Link to this post

    Hello John,

    Here is an example of all needed properties:
    private void RadGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
    {
        e.CellElement.DrawFill = true;
        e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
        e.CellElement.BackColor = Color.Aqua;
    }

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top