ItemSource = DataTable?

Jan 29, 2009 at 7:22 AM
Hello,

how can i use a DataTable as ItemSource?

For example:
_ds  = GetDataSet();
this._dataGrid.ItemsSource = _ds.Tables[0]; //dont work.

I found this topic http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d04229ba-3c96-4aa7-a386-7cd1ce5eedea/ but there will be set the ItemSource in the xaml Code. I have to set this in C#. I need something lik this _dataGrid.ItemSource = _datatabel.
Jan 29, 2009 at 7:31 AM
Okay i got it dataGrid.ItemsSource = DataTable.DefaultView;