Styling value cells same as column header cells

4 posts, 0 answers
  1. Borislav
    Borislav avatar
    16 posts
    Member since:
    Nov 2016

    Posted 28 Sep Link to this post

    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?

  2. Hristo
    Admin
    Hristo avatar
    1023 posts

    Posted 29 Sep Link to this post

    Hi 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.
  3. Borislav
    Borislav avatar
    16 posts
    Member since:
    Nov 2016

    Posted 29 Sep Link to this post

    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?

  4. Hristo
    Admin
    Hristo avatar
    1023 posts

    Posted 02 Oct Link to this post

    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.
Back to Top