This is a migrated thread and some comments may be shown as answers.

Datagrid background color where no rows

3 Answers 325 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 09 Mar 2015, 08:18 PM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Mahmoud
Top achievements
Rank 1
answered on 11 Mar 2015, 03:47 PM
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;

0
Stefan
Telerik team
answered on 12 Mar 2015, 11:29 AM
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. 

Regards,
Stefan
Telerik
 

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.

 
0
Mark
Top achievements
Rank 1
answered on 12 Mar 2015, 08:58 PM
Thank you.  This worked perfectly.
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Mahmoud
Top achievements
Rank 1
Stefan
Telerik team
Mark
Top achievements
Rank 1
Share this question
or