在WinForm里如何让DataGrid里一个单元格为不可修改?? winform中dataGridView可以做到设置cell的 readOnly=true;即可 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 很難控制﹐不過可以在CurrentCellChanged事件中控制(一定要有TableStyle)﹐將需要設為ReadOnly的單元格保存在數組中﹐然后判斷﹕例﹕ArrayList Cells=new ArrayList();Cells.Add(new DataGridCell(2,3));Cells.Add(new DataGridCell(5,4));//下面的在CurrentCellChanged的事件中添加if(Cells.IndexOf(Grid.CurrentCell)>-1) Grid.TableStyles[0].GridColumnStyles[Grid.CurrentCell.ColumnNumber].ReadOnly=true; else Grid.TableStyles[0].GridColumnStyles[Grid.CurrentCell.ColumnNumber].ReadOnly=false; 在cellbeginedit事件中取消(cancle=true) 关于app.config文件读写 有没有IndexOf方面的例子? 请教高手,在利用反射时如何来识别某个参数是个 params 的问题。 网页中使用activex控件除了使用<object>标签的方法,还有其他方法吗? picturebox控件的委托怎么写 C#调用摄像头无法重复启动,点开第一次,没问题,但是如果再点第二次就会报错,怀疑资源没有释放,请高手指点 C# C#调试问题,急~~ TableMappings映射的问题 .net帮助中的例子的.bat文件如何执行? (求:)如何判断你想要的打印机!? 未能找到存储过程的问题
將需要設為ReadOnly的單元格保存在數組中﹐然后判斷﹕
例﹕
ArrayList Cells=new ArrayList();
Cells.Add(new DataGridCell(2,3));
Cells.Add(new DataGridCell(5,4));
//下面的在CurrentCellChanged的事件中添加
if(Cells.IndexOf(Grid.CurrentCell)>-1)
Grid.TableStyles[0].GridColumnStyles[Grid.CurrentCell.ColumnNumber].ReadOnly=true;
else
Grid.TableStyles[0].GridColumnStyles[Grid.CurrentCell.ColumnNumber].ReadOnly=false;