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
695
ComboBox in EditorTemplate does not get custom style
posted

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>

                        <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.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>

        </ResourceDictionary>

 

 

Parents
  • 40030
    Verified Answer
    Offline posted

    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.

    -SteveZ

Reply Children