在gridview中添加滚动条 [英] add scrollbar in gridview

查看:74
本文介绍了在gridview中添加滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


当有很多列要显示时,有谁知道如何将ScrollBars添加到GridView中?



谢谢和问候......

Sand。

Hi all,

Does anyone know how we can add a ScrollBars into a GridView when it has a lot of columns to display?


Thanks and Regards...
Sand.

推荐答案

将DataGrid Web控件拖放到页面上并调整大小达到你想要的尺寸。


然后将HTML Label Control拖放到页面上。这与< div>相同。我使用的是html版本,因为我不需要任何与Web控件相关的额外功能(或开销)。我建议给这个控件一个id,以便在进行进一步的更改时更容易找到。


接下来,我可以将datagrid拖到标签内部。你知道当标签突然获得焦点时,你已经把它放在正确的位置。删除网格时,标签将自动调整为网格大小。


此外,您会注意到标签左上角有一个锚点,可以拖动组合控件。也可以在设计屏幕中选择单个控件,以便您可以根据需要影响其中任何一个。


下一个关键步骤是启用滚动条。您可以通过进入标签的STYLE属性来完成此操作。而不是手动编辑它们,打开控件的样式构建器。这可以通过右键单击标签并选择构建样式来完成。或单击属性窗口中样式参数的省略号。


在样式构建器的布局页面上,有一个Overflow选项。溢出有五个设置。其中一个是空白的,两个用于滚动,两个用于剪裁。我使用如果需要使用滚动条选择。


Drop a DataGrid Web control onto the page and resize it to the size you would like.

Then drop an HTML Label Control onto the page. This is the same as a <div>. I am using the html version, since I do not need any of the extra features (or overhead) associated with a Web control. I would recommend giving this control an id, so that it is easier to find when making further changes.

Next, I can drag the datagrid inside of the label. You know you''ve got it in the right spot to drop when the label suddenly gains focus. When you drop the grid, the label will automatically resize itself to the size of the grid.

Additionally, you will notice that there is an anchor in the upper left corner of the label which will allow you to drag the combined controls. It is possible to select the individual controls as well in the design screen so that you can affect either of them as needed.

The next key step is to enable the scroll bar. You do this by going into the STYLE properties of the label. Rather than manually editing them, open up the style builder for the control. This can be done by right clicking on the label and choosing "Build Style" or clicking on the ellipsis on the style parameter in the properties window.

On the layout page of the style builder, there is an option for Overflow. Overflow has five settings. One of these is blank, two are for scrolling and two are for clipping. I use the "Use Scrollbars if Needed" selection.



大家好......

有谁知道我们如何添加滚动条到gridview什么时候有很多列要显示???

请帮忙...

谢谢和问候......

sand ...
hi all...
does anyone know how we can add a scrollbar into a gridview when it''s having a lot of columns to display???
please help...
thanks and regards...
sand...



将DataGrid Web控件拖放到页面上并将其大小调整为大小你想要。


然后将HTML Label Control拖放到页面上。这与< div>相同。我使用的是html版本,因为我不需要任何与Web控件相关的额外功能(或开销)。我建议给这个控件一个id,以便在进行进一步的更改时更容易找到。


接下来,我可以将datagrid拖到标签内部。你知道当标签突然获得焦点时,你已经把它放在正确的位置。删除网格时,标签将自动调整为网格大小。


此外,您会注意到标签左上角有一个锚点,可以拖动组合控件。也可以在设计屏幕中选择单个控件,以便您可以根据需要影响其中任何一个。


下一个关键步骤是启用滚动条。您可以通过进入标签的STYLE属性来完成此操作。而不是手动编辑它们,打开控件的样式构建器。这可以通过右键单击标签并选择构建样式来完成。或单击属性窗口中样式参数的省略号。


在样式构建器的布局页面上,有一个Overflow选项。溢出有五个设置。其中一个是空白的,两个用于滚动,两个用于剪裁。我使用如果需要使用滚动条选择。
Drop a DataGrid Web control onto the page and resize it to the size you would like.

Then drop an HTML Label Control onto the page. This is the same as a <div>. I am using the html version, since I do not need any of the extra features (or overhead) associated with a Web control. I would recommend giving this control an id, so that it is easier to find when making further changes.

Next, I can drag the datagrid inside of the label. You know you''ve got it in the right spot to drop when the label suddenly gains focus. When you drop the grid, the label will automatically resize itself to the size of the grid.

Additionally, you will notice that there is an anchor in the upper left corner of the label which will allow you to drag the combined controls. It is possible to select the individual controls as well in the design screen so that you can affect either of them as needed.

The next key step is to enable the scroll bar. You do this by going into the STYLE properties of the label. Rather than manually editing them, open up the style builder for the control. This can be done by right clicking on the label and choosing "Build Style" or clicking on the ellipsis on the style parameter in the properties window.

On the layout page of the style builder, there is an option for Overflow. Overflow has five settings. One of these is blank, two are for scrolling and two are for clipping. I use the "Use Scrollbars if Needed" selection.



非常感谢Vinay ....

早些时候我曾尝试使用div ...然后我无法得到它。 ..

但现在我明白了...

谢谢,

沙......


Thanks a lot Vinay....
Earlier i had tried using div...then i was not able to get it...
but now i got it...
thanks,
sand...


非常感谢vinaykeshav

你是最好的...

真的,这是最好的答案!

对你有好处..

Nir ​​
thanks alot vinaykeshav
you are the best...
really it"s the best answer!
good for you man..
Nir


这篇关于在gridview中添加滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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