My wpf app xaml is simple, only a datagrid:
<DataGrid ItemsSource="{Binding UserCollection}"/>
In code behind, UserCollection is a DataTable:
private DataTable userCollection;
public DataTable UserCollection
{
get { return this.userCollection; }
set
{
this.userCollection = value;
NotifyPropertyChanged();
}
}
In ViewModel.cs, code is simple, create 2 columns and add a row:
this.UserCollection = new DataTable();
UserCollection.Columns.Add("col1", typeof(int));
UserCollection.Columns.Add("co.l2", typeof(int));
var r=UserCollection.NewRow();
r["col1"] = 1;
r["co.l2"] = 2;
UserCollection.Rows.Add(r);
But the 2nd column which hearder contains a dot cannot display the value in UI, you can see the picture.
Why?