I am using xamGrid version 2010.3 and I have overridden my default combobox style and put it in a resource called DefaultStyles.xaml that is referenced through app.xaml (as is XamGrid.xaml). The style is picked up in the ItemTemplate but not in the EditorTemplate. I have tried both putting not style attribute - to pick up the default and specifying a style attribute, both having the same result (it works in the ItemTemplate but not in the EditorTemplate).
See below for relevant code:
*** TemplateColumn xaml: ***
<ig:TemplateColumn Key="Label.DisplayValue" HeaderText="Label" Width="150">
<ig:TemplateColumn.ItemTemplate>
<DataTemplate>
<ComboBox DisplayMemberPath="DisplayValue" Style="{StaticResource DefaultComboBoxStyle}" SelectedItem="{Binding Label.DataValue, Converter={StaticResource valueConverter}, Mode=TwoWay, ConverterParameter={StaticResource phoneLabelProvider}}" ItemsSource="{Binding Source={StaticResource phoneLabelProvider}, Path=LookupItems}" />
</DataTemplate>
</ig:TemplateColumn.ItemTemplate>
<ig:TemplateColumn.EditorTemplate>
</ig:TemplateColumn.EditorTemplate>
</ig:TemplateColumn>
*** App.xaml Contents: ***
<!-- Global Resources-->
<ResourceDictionary x:Key="Default">
<ResourceDictionary.MergedDictionaries>
<!-- Styles -->
<ResourceDictionary Source="Resources/XamGrid.xaml" />
<ResourceDictionary Source="Resources/Styles.xaml" />
<ResourceDictionary Source="Resources/DefaultStyles.xaml" />
<ResourceDictionary Source="Resources/Toolkit.xaml" />
<!-- Brushes and Colors-->
<ResourceDictionary Source="Resources/Brushes.xaml" />
<ResourceDictionary Source="Resources/Colors.xaml" />
<!-- Data Templates-->
<ResourceDictionary Source="Resources/ControlDataTemplates.xaml" />
<!-- Other Resources -->
<ResourceDictionary>
<core:RegionNames x:Key="RegionNames" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
Noted. thanks.
Hi Greg,
You wouldn't need to upgrade to 11.1, just the latest Service Release (SR) for 10.3.
Just as a side note, when you mention what version, if you provide the build number i .e (10.3.1006) its more helpful as we can then determine if you have the latest SR, or if upgrading to the latest SR will fix your issue.
-SteveZ
Hi Steve,
I mentioned what version we were on hoping you'd fixed the issue. We'll upgrade to 2011.1 soon.
thanks,
-greg
Hi,
There was a bug in this a while back, fixed around March, where we were applying a style to the Root control, , even if it there wasn't style set. By doing that, Implicit styling would work, and we were overriding the set style.
If you get the latest SR it shouldn't be an issue.
If for some reason that isn't possible, you can always set the EditorStyle property on the column instead.
Also, setting the style directly on the combobox in that view doesn't work either: I tried the following.
>
<ComboBox.Style>
/>
<Setter.Value>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Grid>
<Grid.Resources>
<vsm:VisualStateManager.VisualStateGroups>
</vsm:VisualState>
<Storyboard>
</Storyboard>
</vsm:VisualStateGroup>
<DiscreteObjectKeyFrame.Value>
</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</vsm:VisualStateManager.VisualStateGroups>
"1"
></Rectangle>
</Grid>
</Border>
"0"
<ContentPresenter
"contentPresenter"
"
</ControlTemplate>
</Style>
</Grid.Resources>
</sys:Boolean>
<Path.Fill>
</Path.Fill>
</Path>
</ToggleButton>
</ContentPresenter>
<ToolTipService.ToolTip>
<ToolTip.Triggers>
<EventTrigger.Actions>
<BeginStoryboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</ToolTip.Triggers>
</ToolTip>
</ToolTipService.ToolTip>
<Border.Background>
</Border.Background>
<ItemsPresenter/>
</ScrollViewer>
</Popup>
</ComboBox.Style>
</ComboBox>