ria serive 获得数据后绑定DataGrid如何增加新栏

enterzhuang 2012-11-06 10:24:34
用自动绑定栏可以显示数据

但加入代码无法显示数据:
curDataGrid.Columns.Clear();
if (string.IsNullOrEmpty(this.ColumnDisplayName1))
return;
DataGridTextColumn newCol = new DataGridTextColumn();
newCol.Width =new DataGridLength( this.ColumnSize1);
newCol.Binding = new System.Windows.Data.Binding(this.ColumnName1);
newCol.Binding.Mode = System.Windows.Data.BindingMode.TwoWay;
newCol.Header = this.ColumnDisplayName1;
curDataGrid.Columns.Add(newCol);
...全文
69 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

8,735

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧