I am creating a GridViewComboBoxColumn programmatically and so am adding the CellTemplate programmatically with the code:
private
static
DataTemplate GetCellTemplate(GridColumn column, DataTemplate itemTemplate, Binding itemsSourceBinding)
{
FrameworkElementFactory lookupElement =
new
FrameworkElementFactory(
typeof
(LookupElement));
if
(itemsSourceBinding !=
null
)
lookupElement.SetBinding(LookupElementWithStyle.ItemsSourceProperty, itemsSourceBinding);
lookupElement.SetValue(LookupElementWithStyle.ItemTemplateProperty, itemTemplate);
lookupElement.SetValue(LookupElementWithStyle.SelectedValuePathProperty, column.MemberPath);
lookupElement.SetBinding(LookupElementWithStyle.SelectedValueProperty,
new
Binding(column.DataName));
lookupElement.SetValue(LookupElementWithStyle.IsTabStopProperty,
false
);
DataTemplate cellTemplate =
new
DataTemplate()
{
VisualTree = lookupElement
};
cellTemplate.Seal();
return
cellTemplate;
}
The problem with this is that the LookupElement has a RadComboBox property that is displayed in the visual tree but I have no way of overriding the style. The result is that it is using the default FontFamily "Segoe UI SemiBold" when I want to use "Segoe UI", and any gridviewcomboboxcolumns are displayed as semibold. How do I overcome this?