Datagrid background color where no rows

4 posts, 1 answers
  1. Mark
    Mark avatar
    3 posts
    Member since:
    Nov 2012

    Posted 09 Mar 2015 Link to this post

    If I have a data grid and not enough records to fill it then I get a white background shows where there are no rows.  I cannot find a way of changing this.  I have attached an image.  My data grid is red but I end up with a white area at the bottom.  I want to be make this area, where are now rows, red as well please.  Many thanks.
  2. Answer
    Mahmoud avatar
    10 posts
    Member since:
    Mar 2015

    Posted 11 Mar 2015 Link to this post

    radGridView1.TableElement.BackColor = System.Drawing.Color.Red;
    radGridView1.TableElement.BackColor2 = System.Drawing.Color.Red;
    radGridView1.TableElement.BackColor3 = System.Drawing.Color.Red;
    radGridView1.TableElement.BackColor4 = System.Drawing.Color.Red;

  3. Stefan
    Stefan avatar
    2906 posts

    Posted 12 Mar 2015 Link to this post

    Hi guys,

    Thank you for writing.

    Indeed, setting the BackColor of the TableElement is the right way to introduce the desired color setting. Since by default the GradientStyle is set for Linear, you would need to set the 4 back colors as Mahmoud suggested. Or, alternatively, you can set the GradientStyle to Solid:
    radGridView1.TableElement.GradientStyle = GradientStyles.Solid
    radGridView1.TableElement.BackColor = Color.Red

    @Mahmoud, thank you for the community effort. I have updated your Telerik Points accordingly. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  4. Mark
    Mark avatar
    3 posts
    Member since:
    Nov 2012

    Posted 12 Mar 2015 in reply to Mahmoud Link to this post

    Thank you.  This worked perfectly.
Back to Top