GridControl控件使用小结
GridControl增加空白行:
GridControl在未邦定数据源之前,是无法添加行的。先要邦定一个数据源,哪怕是个空数据源
this.gridView1.AddNewRow();
GridControl单格输入:
单元格输完数据后清空的情况,是因为字段没有邦定。邦定一下字段就可能了。
这里发现一个小bug:有时候select * from table ,字段邦定数据显示不出来。这种情况下用 select field1,field2 from table
GridControl单格显示类型:比如货币型: this.colUnitPrice.DisplayFormat.FormatString = "C";
this.colUnitPrice.DisplayFormat.FormatType = FormatType.Numeric; //这句一定要加上,否则没有效果