ASP.NET GridView获取与第一个标题行相关的第二个标题行 [英] ASP.NET GridView get the second header row which related to the first one

查看:69
本文介绍了ASP.NET GridView获取与第一个标题行相关的第二个标题行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经通过Grid View创建了一个表格,如:


A | B | C | D |
1 | X | X | X |
2 | X | X | X |
3 | X | X | X |

B C D是来自数据库table1的数据,我通过sql查询得到它们

表1中还有另一个属性,b代表B,c代表C,d代表D.

我需要实现这样的表:


A | B | C | D |
| b | c | d |
1 | X | X | X |
2 | X | X | X |
3 | X | X | X |


有人可以帮我吗?看来我可以使用Grid View的OnRowCreated,但是我不知道如何实现...

非常感谢!!

Hi everyone,

I''ve created a table by Grid View like:


A | B | C | D |
1 | X | X | X |
2 | X | X | X |
3 | X | X | X |

B C D are data from database table1 and I get them by Sql query

there is another attribute in the table1, b for B, c for C and d for D.

I need to realize the table like this:


A | B | C | D |
| b | c | d |
1 | X | X | X |
2 | X | X | X |
3 | X | X | X |


does anyone could help me please? it seems that I can use OnRowCreated of Grid View, but I don''t know how to realize...

many thanks!!

推荐答案


您需要根据来自数据库的数据合并gridview的标头.请参阅下面的链接以获取类似的文章:
在ASP.NET中合并的GridView列标题 [ ^ ]
合并标题-GridView/DataGrid [在GridView中合并单元格 [
Hi,
You need to merge the headers of gridview according to the data coming from database. Refer the links below for similar articles:
GridView column header merging in ASP.NET[^]
Merge Header - GridView/DataGrid[^]
Cell Merging In GridView[^]



--Amit


这篇关于ASP.NET GridView获取与第一个标题行相关的第二个标题行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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