WPF DataGrid Binding Issue

Feb 20, 2009 at 10:21 PM
Why do you have to bind the WPF DataGrid control ItemSource in or after the Loaded event to show the column names?  If I use the code below when my UI is created, it will bind and show the data, but covers the column names.  I have to use code below in Loaded event or after ( Click button, etc. ).  Is this a known bug and will it be fixed in next released?  Thanks

// Note: listOfData is ObservableCollection<>

// Bind lists to UI.

 

dgTooFew.ItemsSource =  listOfData;

Feb 22, 2009 at 6:47 AM
Edited Feb 22, 2009 at 6:55 AM
      DataContext = CheckBook.Register;
---->
      dg.ItemsSource = CheckBook.Register;

can do?
runing throw error.

不会说English.
don't speak English.