RadControl.Font Override

2 posts, 0 answers
  1. Tyler
    Tyler avatar
    17 posts
    Member since:
    Jun 2016

    Posted 23 Feb 2017 Link to this post

    here is the scenario..  

    I am trying to create some wrapper classes for controls that display text such as labels, etc.  What I am seeing is that I am copy and pasting the same font override function for each control.  


    Is there a recommended way of overriding the RadControl.Font and utilize that?  The problem, is the wrapper class can only have a single base class..  MyRadLabel : RadLabel


    any pointers would be nice.  I hope I am just missing something small that I am not thinking of..

  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4173 posts

    Posted 24 Feb 2017 Link to this post

    Hello Tyler,

    Thank you for writing.  

    Note that all controls in the Telerik UI for WinForms suite support theming mechanism where the style for each inner element in the control's elements structure is specified. Thus, the font can be specified for the element in the theme as well. There is not a unified way for applying the Font for all controls because of the diverse internal structure of the controls.

    The possible solution that I can suggest is to the iterate the Form.Controls collection and set the Font property for each control. However, for more complex controls like RadGridView, the font is specified at the cell level and it is necessary to use the CellFormatting event.

    I hope this information helps. Should you have further questions I would be glad to help.

    Telerik by Progress
    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