user1347778
user1347778

Reputation:

windows phone 7.1 listBoxItem having Text and value

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

Answers (1)

McGarnagle
McGarnagle

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

Related Questions