Skip to content

Sort a Bound DropDown In WPF

June 9, 2014
tags: ,

This came up a while back and had me a bit flustered for a bit.  You’re getting some data that you don’t have a ton of control over that you’re binding right into a ddl in WPF and you want to sort it because well, sorting is important.

It isn’t too late!  You can do the following in your constructor and it’ll look fine.

ddlAssignTo.Items.SortDescriptions.Add(new SortDescription(“Username”, ListSortDirection.Ascending));

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: