We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Unable to change GridDataControl font/font size

Hi all,

I'm currently having problems altering the Font/Fontsize across the entire GridDataControl programatically.

In xaml there is a style applied to the GridDataControl to set the font to Ariel.

However when I run the app and do the following in code:

BlotterConfigModel model = dlg.BlotterConfigModel;
gridControl1.Model.RowHeights.DefaultLineSize= model.RowHeight;

gridControl1.FontFamily = model.Font;
gridControl1.FontSize = model.FontSize;

gridControl1.InvalidateVisual();

The rows size changes but the font remains the same. Using the debugger I can see the font has changed in the model but visually nothing happens.

Anyone have any thought on this?

Thanks.

Kishor.

3 Replies

GK Ganesan K Syncfusion Team May 21, 2010 08:53 AM UTC

Hi Kishor,

Thank you for using Syncfusion Products.

You need to call ApplyFont() method as follows after modifying the Font information,

gridControl1.Model.ApplyFont();

Please let us know if you need any further details.

Thanks
Ganesan


KK Kishor Kukadia May 26, 2010 04:27 PM UTC

Hi thanks for the suggestion. However I'm having a couple of issues applying the change you suggested.

My gridControl1 is of type GridDataControl

The Model is hence of type GridDataTableModel

GridDataTableModel doesn't have a pubic function called ApplyFont(). I'm using syncfusion 8.2.0.18 and I'm using the WPF GridDataControl.

Thanks.

Kishor.



VP Varun P Syncfusion Team June 1, 2010 07:06 PM UTC

Hi Kishor,

We are very sorry for the delay in getting back to you.

This method was not present in GridDataControl in v8.2.0.18. We have added this method in our latest source. In order to get the latest dll's could you please create a Direct Trac incident.

Please let me know if you have any queries.

Thanks,
Varun

Loader.
Live Chat Icon For mobile
Up arrow icon