如何动态更改datagrid的列readonly属性 100PrinceT
1个回答
展开全部
若是模板列 就可以
DataGrid1.items(0).cell(1).controls(0).readonly=false
在datagrid列中,databoundcolumn有只读属性,在绑定时设定:
bc = new BoundColumn();
bc.HeaderText = "顾客方";
bc.DataField = "CompanyName";
bc.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;
bc.ItemStyle.HorizontalAlign=HorizontalAlign.Center;
bc.ItemStyle.Width=(Unit)0.20;
bc.ReadOnly = true;
bc.ItemStyle.Wrap = false;
MyDataGrid.Columns.Add(bc);
DataGrid1.items(0).cell(1).controls(0).readonly=false
在datagrid列中,databoundcolumn有只读属性,在绑定时设定:
bc = new BoundColumn();
bc.HeaderText = "顾客方";
bc.DataField = "CompanyName";
bc.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;
bc.ItemStyle.HorizontalAlign=HorizontalAlign.Center;
bc.ItemStyle.Width=(Unit)0.20;
bc.ReadOnly = true;
bc.ItemStyle.Wrap = false;
MyDataGrid.Columns.Add(bc);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询