Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: CheckComboBox Not Displaying Checks

$
0
0
While the delimited string of selected items displays correctly, their associated checkboxes remain unchecked. Surely, I'm doing something wrong. I threw together the simplest demo I could to demonstrate the behavior. Any help would be appreciated.

Code Behind:
using System.Collections.ObjectModel;
using System.Windows;

namespace TestProject
{
    public partial class Test : Window
    {
        public Test()
        {
            InitializeComponent();
            
            var selectedOptions = new ObservableCollection<string>() { "One", "Two", "Three" };
            var selectableOptions = new ObservableCollection<SelectableOption>()
            {
                new SelectableOption {Display = "One", Value = "1"},
                new SelectableOption {Display = "Two", Value = "2"},
                new SelectableOption {Display = "Three", Value = "3"},
                new SelectableOption {Display = "Four", Value = "4"},
                new SelectableOption {Display = "Five", Value = "5"}
            };

            ComboBox.ItemsSource = selectableOptions;
            ComboBox.DisplayMemberPath = "Display";
            ComboBox.SelectedMemberPath = "Value";
            ComboBox.SelectedItemsOverride = selectedOptions;
        }

        public class SelectableOption
        {
            public string Display { get; set; }
            public string Value { get; set; }
        }
    }
}
and the XAML:
<Window x:Class="TestProject.Test"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="Test" Height="178" Width="300">
    <Grid>
        <xctk:CheckComboBox  x:Name="ComboBox" 
                             Margin="10,33,10,0" 
                             VerticalAlignment="Top" 
                             TabIndex="3" 
                             Height="22"
                             RenderTransformOrigin="0.743,-1.136"
                             />
    </Grid>
</Window>

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>