bind data from dattable with datagrid
WPF
1
Posts
1
Posters
0
Views
1
Watching
-
i tried to bind data from datatable to wpf datagrid with code behind
Binding b = new Binding();
ExcelParser exc = new ExcelParser();
DataTable dt = exc.GetDataTableExcel(datasource);
b.Source = dt.DefaultView;
b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
b.Path = new PropertyPath("F1");
this.dgvreceipient.SetBinding(TextBlock.TextProperty, b);when i use xamlcode it work:
but i need to have this on code behind.