Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
625
Setting the font of columns/cell with style DropDownList
posted

Hello,

we have columns or individual cell that have been set to use a dropdown list like this (column case):

column.EditorComponent = null;
column.Style = ColumnStyle.DropDownList;
column.ButtonDisplayStyle = ButtonDisplayStyle.OnCellActivate;
column.ValueList = GetOrCreateValueList(layout, key); // some method to build a value list

In case we run in a Chinese UI culture we want to set a dedicated font. To achieve this we set a couple of appearance overrides in a handler of the InitializeLayout event:

eventArgs.Layout.Override.CellAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.ActiveRowAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.EditCellAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.SelectedRowAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.RowAppearance.FontData.Name = "Microsoft Yahei";

eventArgs.Layout.Override.ActiveRowCellAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.FixedCellAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.FixedRowAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.FixedRowCellAppearance.FontData.Name = "Microsoft Yahei";
eventArgs.Layout.Override.ReadOnlyCellAppearance.FontData.Name = "Microsoft Yahei";

Now the problem: the cells/columns that have the dropdown list style set use the wrong font in the following cases:

- when the row is not selected

- in the drop down list

Do you have a suggestion how I can make sure that the font is properly I set in the two cases? 

I tried to get a reference to the EditorWithCombo instance after setting the column.Style property but I don't know how to set the font family there and if that would help to solve the issues anyway.

Thanks and best regards

Uwe

Parents Reply Children