我已經寫了下面的代碼來顯示一些數據,但數據網格僅僅顯示爲空, 這裏是我的代碼:數據沒有出現在DataGrid Kinect的C#
DataTable dt = new DataTable();
DataColumn col = new DataColumn("A", typeof(string));
col.MaxLength = 100;
dt.Columns.Add(col);
col = new DataColumn("B", typeof(string));
col.MaxLength = 100;
dt.Columns.Add(col);
DataRow row = dt.NewRow();
dt.Rows.Add(x,y);
dataGrid1.ItemsSource = dt.DefaultView;
使用調試器.... –
我用它和網格具有數據,但是當我運行它只是出現空行 – Tak
是的,正如你可以看到上面,我定義它們後,我將它們添加到數據表 – Tak