Hi
I am trying to use xamComboEditor. In my main project the items have a white foreground and background colour, unless I mouse over the item - in which case I can see the text. Otherwise it just looks blank.
In a stand alone project I can get it too work?
I have tried to apply themes and it still doesnt work?
I cant find anything that would clash with it.
Please help
Chris
code behind binds to dataset then....
this.itemsProvider1.DisplayMemberPath = "Desc";this.itemsProvider1.ValuePath = "ID";
Sorry for being annoying I just dont want to waste your time. I guess my question is how can I use something like above but just to change background and foreground color, so scrap the alternating. And change it so i can put in page.resources or better resource dictionary, and easily apply across all my combos?
Hi Andrew
I have this style, its crappy but good example. I can work on it. Do you know how I can change to be applied globally so to speak - I mean like put into a page.resources or a resource dictonary. I cant repeat on each combo would be bad programming but when i put into page resources i get error?
Thanks in advance. Just trying to safe time. best to ask the guru's
<igEditors:XamComboEditor.ComboBoxStyle> <Style TargetType="ComboBox"> <Style.Resources> <AlternationConverter x:Key="BackgroundConverter"> <SolidColorBrush Color="Blue" /> <SolidColorBrush Color="Red" /> </AlternationConverter> <Style TargetType="ComboBoxItem" x:Key="alternatingItem"> <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Self}, Path=(ItemsControl.AlternationIndex), Converter={StaticResource BackgroundConverter}}"/> </Style> </Style.Resources> <Setter Property="ItemContainerStyle" Value="{StaticResource alternatingItem}" /> <Setter Property="AlternationCount" Value="2" /> </Style> </igEditors:XamComboEditor.ComboBoxStyle>
Thanks Andrew. That is what I meant foreground and background same colour for items. To make matters worse the only WPF program that snoop doesnt work on is the one I need it too. Its built upon a large codeplex project.
Is there any way that I can style the ComboBoxItem so that it doesnt inherit? Do you a small example? Im pretty desperate to get over this before saturday so i can get on with the project ;$
So just to be clear, the text within the items in the dropdown are not visible until you mouse over them. If so then it sounds like the Foreground property is the same as the Background property. The xamComboEditor contains a ComboBox in its EditTemplate and it is that combobox that provides the dropdown. The ComboBox creates a ComboBoxItem for each item in the list. We do not provide a custom style for that class so maybe you have a Style for that class in the ancestor chain that is providing the Foreground/Background that is being used. Without a sample I cannot say what is specifically leading to the problem so you would likely need to run something like Snoop and inspect the tree to see where the values for the Foreground/Background are coming from.