Reputation:
Is there a way i can set listBoxItem Content as well as another hidden value (simply a id or somthing) to?
Upvotes: 0
Views: 148
Reputation: 102753
Yes, use DisplayMemberPath and SelectedValuePath on the ListBox
that contains them. If your data items are objects of class Foo
with properties Text
and ID
, then use:
<ListBox DisplayMemberPath="Text" SelectedValuePath="ID"
... />
Upvotes: 1