DataGridCheckBoxColumn cb=new DataGridCheckBoxColumn();
cb.Header="选择";
DataGridTextColumn tc = new DataGridTextColumn();
Binding b = new Binding("Spaceid");
tc.Header = "版块标题";
tc.Binding = b;
DataGridTextColumn tn = new DataGridTextColumn();
Binding c = new Binding("Spacename");
tn.Header = "版块名称";
tn.Binding = c;
dataGrid1.Columns.Add(cb);
dataGrid1.Columns.Add(tc);
dataGrid1.Columns.Add(tn);
List<ServiceReference1.Space> list = new List<ServiceReference1.Space>(e.Result);
dataGrid1.ItemsSource = list;
如题,数据源是有WCF来获取的,怎样将数据绑定到datagrid。同时我需要增加模板列来放置图片。不知道该怎么写?
我的代码运行后什么都没有了,连开始的UI都不见了!