在 c# Winforms 中对 DataGridview 进行分组 [英] Grouping DataGridview in c# Winforms

查看:119
本文介绍了在 c# Winforms 中对 DataGridview 进行分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 c# winforms 的 datagridview 中有以下数据:

Hi I have the following data in datagridview in c# winforms:

 Register 1  |       10,00     |       15,00 | Group 1
 Register 2  |       10,00     |       15,00 | Group 1
 Register 3  |       10,00     |       15,00 | Group 2
 Register 4  |       10,00     |       15,00 | Group 2

我想以下列形式得到它:

I want to get this in the following form:

第 1 组
注册 1 |10,00 |15,00
注册 2 |10,00 |15,00
第 1 组
注册 3 |10,00 |15,00
注册 4 |10,00 |15,00

Group 1
Register 1 | 10,00 | 15,00
Register 2 | 10,00 | 15,00
Group 1
Register 3 | 10,00 | 15,00
Register 4 | 10,00 | 15,00

我不想使用多个数据网格视图

I dont want to use multiple datagridviews

推荐答案

内置的 WinForms DGV 不支持分组.这是一篇有人自己添加了此功能的文章(请注意,我自己没有使用过此功能,因此不做推荐):http://blogs.vbcity.com/hotdog/archive/2008/12/19/9226.aspx

The built-in WinForms DGV does not support grouping. Here is an article where someone has added this functionality themselves (note that I have not used this myself and so am not making a recommendation): http://blogs.vbcity.com/hotdog/archive/2008/12/19/9226.aspx

另外,还有无数第三方 DGV 控件出售.Infragistics 有一个很好的我可以推荐它确实提供分组:http://www.infragistics.com/dotnet/netadvantage/winforms/wingrid.aspx#Overview

Alternately there are countless third-party DGV controls for sale. Infragistics has an excellent one that I can recommend which does provide grouping: http://www.infragistics.com/dotnet/netadvantage/winforms/wingrid.aspx#Overview

这篇关于在 c# Winforms 中对 DataGridview 进行分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆