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

Created Unassigned: CheckComboBox ItemTemplate no longer working [20617]

$
0
0
The ItemTemplate property has no effect, try the simplest possible test and it will not work. DisplayMemberPath still works though. I'm assuming the ControlTemplate got messed up in recent versions. Luckily ItemTemplate works in version 1.6 of this control, but I'd really like to use the new nuget package for version 2.0.

<Window x:Class="CheckComboBoxTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit">
<Grid>
<xctk:CheckComboBox Height="25" ItemsSource="{Binding Items}">
<xctk:CheckComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}" />
</DataTemplate>
</xctk:CheckComboBox.ItemTemplate>
</xctk:CheckComboBox>
</Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CheckComboBoxTest
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Items = new ObservableCollection<Item>();
Items.Add(new Item("Item 1"));
Items.Add(new Item("Item 2"));
Items.Add(new Item("Item 3"));
Items.Add(new Item("Item 4"));
Items.Add(new Item("Item 5"));
this.DataContext = this;
}

public ObservableCollection<Item> Items { get; set; }
}

public class Item
{
public Item(string displayName)
{
this.DisplayName = displayName;
}
public string DisplayName { get; set; }
}
}

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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