本文介绍了使用C#对DataGridView进行分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { GridViewHelper helper = new GridViewHelper(this.dataGridView1); helper.RegisterGroup("Name", true, true); helper.ApplyGroupSort(); }
它给我:类型找不到名称空间名称'GridViewHelper'(你错过了使用指令或程序集引用吗?) 我想要有这样的: 10tec/articles/screenshots/datagridview-grouping-with-datagridviewgrouper-component.png [ ^ ]
推荐答案你需要让班级 GridViewHelper 在您的项目中引用,作为源代码文件或引用的程序集。 如果没有该类,则为死在水里。 我猜你从这里得到了示例代码 C#/ VB.NET中的DataGridView分组:两个食谱 [ ^ ],但似乎您所喜欢的组件的链接已损坏。 也许你可以使用其他一个例子。 You need to have the class GridViewHelper referenced in your project, either as a source code file or as a referenced assembly. Without that class you are dead in the water. I guess you got the example code from here DataGridView Grouping in C#/VB.NET: Two Recipes[^], but it seems like the link to the component you like is broken. Maybe you can use one of the other examples.
更多推荐
使用C#对DataGridView进行分组
发布评论