user1524578
user1524578

Reputation: 75

DisplayMemberPath in Listbox

I have struct which includes 2 strings : Name, Uid. I add this struct into listbox and I want that the listbox to show only a Name of struct. How I can do this??

Thanks!

   public struct ListItemEl
{
    public string Name;
    public string Uid;
}

Upvotes: 1

Views: 321

Answers (1)

brunnerh
brunnerh

Reputation: 184727

Those need to be public properties if you want DisplayMemberPath (which should just to be set to Name) to work.

Upvotes: 2

Related Questions