This project has moved. For the latest updates, please go here.

Issue with Watermark ComboBox ContentPresenter XAML


There is an issue portrayed here:

Code of which is as follows:

cmb_Class.ItemsSource = from c in Container.Classes select new {ClassID = c.Class_Id};
cmb_Class.DisplayMemberPath = "ClassID";
I had used DisplayMemberPath so that I can only get the assigned value.


The problem is that when I select an item from the dropdown menu, instead of that item the whole string is shown as selected item in the Combobox.

The solution is to add ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" into the <ContentPresenter x:Name="ContentSite" line of the Xaml.


BoucherS wrote Mar 20 at 12:45 PM


Can you please elaborate on this ?
The XAML of the WatermarkComboBox doesn't contains a ContentPresenter with " x:Name="ContentSite"".
Which version of the Toolkit are you using ?
In 3.3, this bug is not present.
Also tried with v3.0 and bug is not present.
Here's the sample used :
<xctk:WatermarkComboBox x:Name="cmb_Class" />
 public partial class MainWindow : Window
    public MainWindow()

      cmb_Class.ItemsSource = new List<MyData>() { new MyData() { ClassID = 1 }, new MyData() { ClassID = 2 }, new MyData() { ClassID = 3 } };
      cmb_Class.DisplayMemberPath = "ClassID";

  public class MyData
    public int ClassID
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF