如何通过对行进行分组来在网格视图中显示数据。 [英] how to display data in a grid view by grouping rows.

查看:74
本文介绍了如何通过对行进行分组来在网格视图中显示数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i在我的项目中有一个网页表单,其中有四个下拉字段。



基于那里的选择我必须显示数据库表中的数据。

但是我必须通过分组来显示数据。



每行有三个字段是重复的,所以我想把它们作为每个组的标题:

Col. Heading - 种类---很多类型---等级

Col. Value - - Teak ------ pole ---------我



这里有关于此的其他细节团队





然后再次

Col. Heading - 种类---很多类型--- - 等级

Col。价值 - - 柚木------极--------- II



这里有关于这个小组的其他细节



像这样我必须在gridview中显示我的数据。

i我正在使用c#代码。



我是如何实现的。


请帮助



谢谢


i have a web form in my project in which there are four drop down fields.

based on there selection i have to show data from database table.
but i have to show data by grouping it.

in each row there are three fields which are repetitive so i want to take them as
header for each Group:
Col. Heading -- species --- lot-type --- grade
Col. Value -- -- Teak ------ pole --------- I

Here other details regarding this group


Then Again
Col. Heading -- species --- lot-type ---- grade
Col. Value -- -- Teak ------ pole --------- II

Here other details regarding this group

Like this i have to show my data in gridview.
i am using c# code.

how i implement this.

please help

thanks

推荐答案





试试DevExpress网格



https://demos.devexpress.com/ASPxGridViewDemos/GroupingSorting/Grouping.aspx [ ^ ]


您好,



您可以使用第三方控件将是不错的选择,但如果您仍想坚持使用Asp.net gridview,那么您可能可以格式化该格式的数据表并将其绑定到数据源。



或者您可以使用内部gridview并绑定Rowdatabound事件中的每个内部控件。



希望这会对您有所帮助
Hi,

You can use a third party controls that will be good option but if you still want to stick with Asp.net gridview, then probably you can format the datatable in that format and bind it to the data source.

Or you can use inner gridview and bind each inner control in Rowdatabound event.

Hope this will help you


这篇关于如何通过对行进行分组来在网格视图中显示数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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