I'm using a XamComboEditor to display foreign key value in XamDataGrid control. The problem is, I have explicitly styled ComboBox and ComboBoxItems (and other base controls such as TextBoxBase, TextBox, etc.), now the Items in the XamComboEditor seem to somehow get the styles of ComboBoxItems, but the XamComboEditor is styled in Ifragistics style.
Is there a way to fix this? I want ComboBoxItems to display in IFG themes. Please see the attached picture.
The xamComboEditor contains a ComboBox when it is in edit mode and as such that would use ComboBoxItem instances for the dropdown. You either need to restyle the ComboBoxItem class for that field (or datapresenter control) or alter where you define the "global" explicit comboboxitem you defined. Note, I can't tell from the picture what exactly doesn't look right so if you want us to look into this please attach a small sample that demonstrates the issue.
Hello, Thanks for your answer. If you see the picture more closely, combobox item have a background gradient when active and black background when inactive. Normal ComboBoxItems have White background with black foreground.
I wonder how I can change the style of the combobox of a specific field? Is there any existing sample to show how to apply a simple style?
Is it possible that we can write style for specific ComboItem in ComboBox only?
Thanks...I've fixed the problem by applying a new style on XamDataGrid resources. In case anyone is intrested :
<igdp:XamDataGrid.Resources> <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}"> <Setter Property="Foreground" Value="Black" /> <Setter Property="Background" Value="White" /> </Style> </igdp:XamDataGrid.Resources>This "removed" the implicit style assigned to comboboxitems when xamComboEditor opened.
You can set the EditorStyle property of the Field's Settings to a style for the xamComboEditor. In the Resources section of that Style, you would define a Style for the ComboBoxItem.