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

Background Color for GridView

4 Answers 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 19 Dec 2017, 04:01 PM

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?

 

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 20 Dec 2017, 07:33 AM
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.
0
John
Top achievements
Rank 1
answered on 20 Dec 2017, 03:49 PM

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.

0
John
Top achievements
Rank 1
answered on 20 Dec 2017, 06:21 PM
I got it working, I had to also finagle with the gradient to fill
0
Dimitar
Telerik team
answered on 21 Dec 2017, 08:42 AM
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.
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
John
Top achievements
Rank 1
Share this question
or