WPF ListBox - how to put values from dataTable?
I have ListBox and want to put values in this listbox from a DataTable : listBoxVisibleFields.DataContext = SelectedFields; Where SelectedFields is a DataTable filled with data. But this code does not work. My ListBox is empty. As I remember, in WinForms was sucha a thing for list box like ValueMember and DisplayMember , but in WPF I dont find something like that... Does someone know how to fill simply my ListBox from DataTable ? The property you are looking for is ItemsSource instead of DataContext . The property most closely resembling ValueMember is called SelectedValuePath (see this