silverlight中DataGrid怎样动态添加列
我是这样写的,dgShow是前台的datagrid:
DataGridTextColumn txtColumn = new DataGridTextColumn();
txtColumn.Header = "场次";
List<string> listThis = new List<string>();
for (int i = 1; i <= 12; i++)
{
listThis.Add(i.ToString());
}
System.Windows.Data.Binding bind = new System.Windows.Data.Binding("listThis");
txtColumn.Binding = bind;
this.dgShow.Columns.Add(txtColumn);
可是这样值并没有显示出来?而且列被加到最后一列,如果我想加到第一列呢?谢谢
------解决方案-------------------- Data_View_Dgv.Columns.Insert(0,DGCBC);