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

font change

1 Answer 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hossein
Top achievements
Rank 1
hossein asked on 05 Aug 2018, 03:29 PM

Hi

 

Really don't want a thinking for changing font in gridview( WE MUST WRITE CODE IN CellFormatting EVENT FOR A SIMPLE CHANGE FONT??!!!!! ) 

please release a patch for this problem!! default theme font is changeable ( but in filtering form, font wont change ), but another theme totally font unchangeable!!

another component wont change too !!!

See image:

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Aug 2018, 12:01 PM
Hello, Hossein,     

Note that RadGridView is a very complex control which contains a lot of inner elements. The default themes provide identical font for all cells, popups and dialogs that RadGridView shows. However, if you need to change the default font for the entire grid it can't be accomplished by simply setting a single property of RadGridView

In order to customize the font for the cells it is necessary to handle the CellFormatting/ViewCellFormatting event. Note that due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. In order to prevent applying the formatting to other columns' cell elements (because of the cell reuse), all customization should be reset for the rest of the cell elements. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells

If you need to change the font for the filter operators popup, you have to handle the ContextMenuOpening event and change the font for the drop down. For all other similar popups, it is necessary to handle the relevant event and set the Font property for the dialog.

Last, but not least, have in mind that creating a font is a heavy operation and the CellFormatting/ViewCellFormatting event is fired a lot of times. Make sure that you create the font just once and store it into a variable which can be reused instead of creating the font each time the event is fired. 

Off topic, note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Regards,
Dess
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
hossein
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or