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

New Post: CheckBoxComboBox - Problem with displaying Checks

$
0
0
Hi,

Make sure that the selected item in the "SelectedCenters" is an item from the ItemsSource "CostCenterFilter", not a new instance.
Here's my code-behind to work width your xaml :
 public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();

      this.DataContext = this;
      this.CostCenterFilter = new ObservableCollection<MyData>()
      {
        new MyData() { LoadingCenterCode = 1 },
        new MyData() { LoadingCenterCode = 2 },
        new MyData() { LoadingCenterCode = 3 },
        new MyData() { LoadingCenterCode = 4 },
        new MyData() { LoadingCenterCode = 5 },
        new MyData() { LoadingCenterCode = 6 },
        new MyData() { LoadingCenterCode = 7 },
        new MyData() { LoadingCenterCode = 8 },
        new MyData() { LoadingCenterCode = 9 },
        new MyData() { LoadingCenterCode = 10 },
      };
      this.SelectedCenters = new ObservableCollection<MyData>()
      {
        this.CostCenterFilter[3]
        //new MyData() { LoadingCenterCode = 3 }   //This doesn't work !
      };
    }

    public ObservableCollection<MyData> CostCenterFilter
    {
      get;
      set;
    }

    public ObservableCollection<MyData> SelectedCenters
    {
      get;
      set;
    }
  }

  public class MyData
  {
    public int LoadingCenterCode
    {
      get;
      set;
    }
  }
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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