Data is visible in DataSet visualizer but does not show in a DataGrid
Solution 1:
When DataGrid generates columns for its ItemsSource, it uses DataTable column names as binding path for columns. While /
symbol is valid in DataColumn names, in has a special meaning in binding path and should be escaped if it is a part of name, e.g. [80/4]
not 80/4
add event handler to AutoGeneratingColumn
event in xaml:
AutoGeneratingColumn="Dg_OnAutoGeneratingColumn"
and modify bindings with this code:
private void Dg_OnAutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
{
var textCol = e.Column as DataGridTextColumn;
if (textCol == null)
return;
var binding = textCol.Binding as Binding;
if (binding == null)
return;
binding.Path = new PropertyPath("[" + binding.Path.Path + "]");
}