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

Styling value cells same as column header cells

3 Answers 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Borislav
Top achievements
Rank 1
Borislav asked on 28 Sep 2017, 03:51 PM

Hi,

how to set styling (font size, color etc) on a value cell to be exactly the same as the cell that represents column header that value cell belongs to?

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 29 Sep 2017, 08:54 AM
Borislav,

Thank you for writing.

One way would be to use the Visual Style Builder tool and customize the GridDataCellElements in the theme. Information on you can work with the tool you can find here: http://docs.telerik.com/devtools/winforms/tools/visual-style-builder/overview.

An alternative solution is to handle the CellFomatting event. In this event, you have access to the data cell element and you would be able to change the styling and fonts to the values you need: http://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Borislav
Top achievements
Rank 1
answered on 29 Sep 2017, 10:52 AM

Hi Hristo,

For this purpose, I would prefer to use cell formatting event. Therefore, I suppose there is a easyt way of copying style from current column header cell to the cell being formatted. How to access and copy that style from header cell?

0
Hristo
Telerik team
answered on 02 Oct 2017, 07:49 AM
Hello Borislav,

Thank you for writing back.

There is no direct way to copy the styles from the header cells. You can either check the theme you are using and copy them. Alternatively, you can handle the ViewCellFormating event and cache the settings used for the header cells and later used them for the data cells.

I hope this helps. Please let me know if you have other questions.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 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
Borislav
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Borislav
Top achievements
Rank 1
Share this question
or