0

Having some trouble figuring this out. So I have a simple combobox, and I bind it to an existing DataTable in the code-behind like so:

roomCombo.ItemsSource = ((IListSource) myDataTable).GetList();
roomCombo.DisplayMemberPath = "Number";

The combobox shows everything i have in the Number column, including duplicates, of course. I'm looking for a way to show only unique values ..

Thanks.

user1524713
  • 45
  • 2
  • 6

1 Answers1

0

I found a good way to do this:

DataView view = new DataView(myDataTAble);
DataTable distinctValues = view.ToTable(true, columnName);
user1524713
  • 45
  • 2
  • 6