Devexpress中Gridcontrol查找分组
程序员文章站
2022-09-09 12:52:25
1 private void button1_Click(object sender, EventArgs e) 2 { 3 DataTable dt = new DataTable(); 4 dt.Columns.Add("Group"); 5 dt.Columns.Add("id... ......
devexpress中gridcontrol查找分组 ,具体代码如下所述:
private void button1_click(object sender, eventargs e) { datatable dt = new datatable(); dt.columns.add("group"); dt.columns.add("idex"); dt.columns.add("name"); for (int i = 0; i < 5; i++) { datarow dr = dt.newrow(); dr["group"] = "<5"; dr["idex"] = i.tostring(); dr["name"] = "姓名" + i.tostring(); dt.rows.add(dr); } for (int i = 5; i <= 10; i++) { datarow dr = dt.newrow(); dr["group"] = "(5,10]"; dr["idex"] = i.tostring(); dr["name"] = "姓名" + i.tostring(); dt.rows.add(dr); } for (int i = 10; i <= 15; i++) { datarow dr = dt.newrow(); dr["group"] = "(10,15]"; dr["idex"] = i.tostring(); dr["name"] = "姓名" + i.tostring(); dt.rows.add(dr); } gridcolumnnumber.fieldname = "idex"; gridcolumnname.fieldname = "name"; gridcolumngroup.fieldname = "group"; gridcolumngroup.groupindex = 0; gdc.datasource = dt; gdv.expandallgroups(); for (int i = -1; gdv.isgrouprow(i); i--) { datarow dr = gdv.getdatarow(gdv.getdatarowhandlebygrouprowhandle(i)); if (dr == null) return; if (dr["group"].tostring() == "(5,10]") { gdv.collapseallgroups(); gdv.focusedrowhandle = i; gdv.setrowexpanded(i, true); return; } } }
总结
以上所述是小编给的大家介绍的devexpress中gridcontrol查找分组 ,希望对大家有所帮助
上一篇: 3DSMAX怎么给室外墙体开窗户?
下一篇: Flash MX怎么修改图片背景颜色?
推荐阅读
-
Devexpress中Gridcontrol查找分组
-
通过DevExpress GridControl中的Format Rules来控制网格样式
-
DevExpress中获取GridControl排序之后的List
-
DevExpress中获取GridControl排序之后的List
-
WPF 中DevExpress14.2 GridControl控件的使用
-
WPF在Devexpress的gridcontrol中ComboBox绑定数据
-
Devexpress中Gridcontrol查找分组
-
通过DevExpress GridControl中的Format Rules来控制网格样式
-
DevExpress中获取GridControl排序之后的List
-
关于在DevExpress GridControl中修改过数据 提交更新的问题