I have a view model in my C# 4.0 app which has a System.Data.DataTable that's created in it using a service call. I want to bind this to a datagrid in my XAML file.
I tried following line DataGrid_Loaded event but its getting fired up before my datatable gets created inside the view model.
xaml:
Code
dg:DataGrid Name="myDataGrid" Loaded="DataGrid_Loaded"/>xaml.cs:
Code
myDataGrid.ItemsSource = myViewModel.myDataTable.DefaultView;Thanks.

Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 25, 2015, 8:13 PM EDT