DataGrid Web控件中的标题 [英] Headings in the DataGrid Web Control

查看:56
本文介绍了DataGrid Web控件中的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个基于网络的报告工具,并使用数据网格显示从数据库返回的

信息。


我正在显示列标题绑定列没有问题,但是我需要有一个标题高于其中一些跨越severla列的标题,例如


--------- OverAll Heading ---------

Heading1 Heading2 Heading3


我找不到办法做到这一点。这是可能的,如果是的话,怎么样?


你能给予的任何帮助都会非常感激。


非常感谢。


艾伦

I am writing a web-based reporting tool and using a datagrid to display
information returned from a database.

I am displaying column headings from bound columns with no problems but I
need to have a heading above some of these that spans severla columns e.g.

--------- OverAll Heading ---------
Heading1 Heading2 Heading3

I can''t find a way to do this. Is this possible and, if so, how?

Any help you can give would be very appreciated.

Many thanks.

Alan

推荐答案

查看单元格的columnspan属性,它使得单元格

超过列数。你需要在跨越之前或之后移除其他单元格

。此外,您需要将第1行提升为

标头。一点代码但并非不可能


-

问候,

Alvin Bruney

[ASP .NET MVP http://mvp.support.microsoft.com/default。 aspx]

有花絮吗?在此处获取... http://tinyurl.com/27cok

Alan Lambert <铝********* @ discussions.microsoft.com>在留言中写道

新闻:6D ********************************** @ microsof t.com ...
have a look at the columnspan property of the cell, it makes the cell
stretch over the number of columns. you will need to remove the other cells
before or after you span. additionally you will need to promote row 1 to a
header. bit of code but not impossible

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alan Lambert" <Al*********@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
我正在编写一个基于网络的报告工具,并使用数据网格显示从数据库返回的信息。

我正在显示来自绑定列的列标题没有问题,但是我需要在其中一些标题上面跨越severla列,例如

--------- OverAll Heading --- ------
Heading1 Heading2 Heading3

我找不到办法做到这一点。这是可能的,如果是的话,怎么样?

你能给予的任何帮助都将非常感激。

非常感谢。

艾伦
I am writing a web-based reporting tool and using a datagrid to display
information returned from a database.

I am displaying column headings from bound columns with no problems but I
need to have a heading above some of these that spans severla columns e.g.

--------- OverAll Heading ---------
Heading1 Heading2 Heading3

I can''t find a way to do this. Is this possible and, if so, how?

Any help you can give would be very appreciated.

Many thanks.

Alan



感谢您的回复。


做colspan应该没问题,但我不确定你是什么

表示将第1行提升为标题。第1行不包含

绑定数据的第一条记录吗?这一行中的数据会发生什么变化?或者我完全被误解了吗?

" Alvin Bruney [MVP]"写道:
Thanks for the reply.

Doing the colspan should be no problem but I''m not sure what you mean when
you say promote row 1 to a header. Wouldn''t row 1 contain the first record of
bound data? What would happen to the dat in this row? Or have I completely
misunderstood?
"Alvin Bruney [MVP]" wrote:
查看单元格的columnspan属性,它使单元格拉伸超过列数。你需要在跨越之前或之后移除其他细胞。另外,您需要将第1行提升为
标题。一点代码但并非不可能

-
问候,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
有花絮吗?在此处获取... http://tinyurl.com/27cok
" ;艾伦兰伯特 <铝********* @ discussions.microsoft.com>在消息中写道
新闻:6D ********************************** @ microsof t.com。 ..
have a look at the columnspan property of the cell, it makes the cell
stretch over the number of columns. you will need to remove the other cells
before or after you span. additionally you will need to promote row 1 to a
header. bit of code but not impossible

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alan Lambert" <Al*********@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
我正在编写一个基于网络的报告工具,并使用数据网格显示从数据库返回的信息。

我正在显示绑定的列标题没有任何问题的列,但我需要有一个标题,其中一些跨越severla列,例如

--------- OverAll Heading ------- -
Heading1 Heading2 Heading3

我找不到办法做到这一点。这是可能的,如果是的话,怎么样?

你能给予的任何帮助都将非常感激。

非常感谢。

艾伦
I am writing a web-based reporting tool and using a datagrid to display
information returned from a database.

I am displaying column headings from bound columns with no problems but I
need to have a heading above some of these that spans severla columns e.g.

--------- OverAll Heading ---------
Heading1 Heading2 Heading3

I can''t find a way to do this. Is this possible and, if so, how?

Any help you can give would be very appreciated.

Many thanks.

Alan




>> > --------- OverAll Heading ---------
>> > --------- OverAll Heading ---------
> Heading1 Heading2 Heading3
> Heading1 Heading2 Heading3



根据你的图表,你有一个标题单元格延伸到

整个网格上整个标题----- ------。那就是标题单元格。


你仍然需要每列的标题(heading1,heading2,heading3)。我是

建议一种方法是在绑定之前在位置0插入一个空行到

数据集。然后你可以自定义

itemdatabound上的第0行作为实际的列标题1,2,3等


-

问候,

Alvin Bruney

[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]

得到花絮?在此处获取... http://tinyurl.com/27cok

Alan Lambert <铝********* @ discussions.microsoft.com>在消息中写道

新闻:AF ********************************** @ microsof t.com ...感谢您的回复。

做colspan应该没问题,但是当你说第1行升级为标题时,我不确定你的意思。不会第1行包含绑定数据的第一个记录吗?这一行中的数据会发生什么变化?或者我完全被误解了?

" Alvin Bruney [MVP]"写道:


according to your diagram, you have one header cell stretched across the
entire grid over Overall heading -----------. well that is the header cell.

you still need headers for each column(heading1, heading2, heading3). i was
suggesting one approach would be to insert an empty row at position 0 into
your dataset before binding. then you can customize row 0 on the
itemdatabound to be the actual column headers 1, 2, 3 etc

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alan Lambert" <Al*********@discussions.microsoft.com> wrote in message
news:AF**********************************@microsof t.com... Thanks for the reply.

Doing the colspan should be no problem but I''m not sure what you mean when
you say promote row 1 to a header. Wouldn''t row 1 contain the first record
of
bound data? What would happen to the dat in this row? Or have I completely
misunderstood?
"Alvin Bruney [MVP]" wrote:

查看单元格的columnspan属性,它使单元格拉伸超过列数。你需要在跨越之前或之后移除其他
细胞。另外,你需要将第1行提升为
一个
标题。一点代码但并非不可能

-
问候,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
有花絮吗?在此处获取... http://tinyurl.com/27cok
" ;艾伦兰伯特 <铝********* @ discussions.microsoft.com>在消息中写道
新闻:6D ********************************** @ microsof t.com。 ..
have a look at the columnspan property of the cell, it makes the cell
stretch over the number of columns. you will need to remove the other
cells
before or after you span. additionally you will need to promote row 1 to
a
header. bit of code but not impossible

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alan Lambert" <Al*********@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
>我正在编写一个基于网络的报告工具,并使用数据网格显示
>从数据库返回的信息。
>
>我正在显示绑定列的列标题,没有任何问题,但
>我
>需要有一个标题高于其中一些跨越severla列
>例如
>
> --------- OverAll Heading ---------
> Heading1 Heading2 Heading3
>
>我找不到办法做到这一点。这是可能的,如果是的话,怎么样?
>
>您可以给予任何帮助。非常感谢。
>
>非常感谢。
>
> Alan
>I am writing a web-based reporting tool and using a datagrid to display
> information returned from a database.
>
> I am displaying column headings from bound columns with no problems but
> I
> need to have a heading above some of these that spans severla columns
> e.g.
>
> --------- OverAll Heading ---------
> Heading1 Heading2 Heading3
>
> I can''t find a way to do this. Is this possible and, if so, how?
>
> Any help you can give would be very appreciated.
>
> Many thanks.
>
> Alan




这篇关于DataGrid Web控件中的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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