Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi there. i have following XAML code:
XML
<ComboBox x:Name="MainComboBox" Height="35" Width="250" removed="WhiteSmoke" BorderBrush="Gray"
                  IsEditable="True" TextSearch.TextPath="Name" TextBoxBase.TextChanged="MainComboBox_TextChanged">
            <ComboBox.Resources>
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/>
                <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/>
            </ComboBox.Resources>
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TreeView BorderBrush="Transparent" BorderThickness="0" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type ComboBox}, Mode=FindAncestor}, Path=ItemsSource}">
                        <TreeView.ItemTemplate>
                            <HierarchicalDataTemplate ItemsSource="{Binding Children}" DataType="{x:Type data:SubscriberGroupModel}">
                                <CheckBox Content="{Binding Name}" Height="25" Width="80" />
                            </HierarchicalDataTemplate>
                        </TreeView.ItemTemplate>
                    </TreeView>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox> 


and my code behind:
C#
private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List<SubscriberGroupModel> list = SubscriberGroupDB.GetCustomSubscriberGroup();
            MainComboBox.ItemsSource = list;
        } 


this control doesn't work properly because it produces itms more than once.
my query s correct.
please help me.
thanks alot
Posted
Updated 27-Jan-14 0:47am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900