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

Created Unassigned: Issue with Watermark ComboBox [22510]

$
0
0
There is an issue portrayed here:
http://stackoverflow.com/questions/33175983/how-to-select-item-displayed-by-displaymemberpath-in-wpf-combobox/42412423#42412423

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.

But,

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.

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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