ASP.NET面板控件如何根据gridview行自动调整大小? [英] How does ASP.NET panel control can be made auto size according to the gridview rows ?

查看:382
本文介绍了ASP.NET面板控件如何根据gridview行自动调整大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP.NET面板控件如何根据GridView行数自动调整大小?

我想根据行数,面板大小应该自动增加。



我尝试了什么:



ASP.NET面板控件是如何实现的根据GridView行的数量制作自动尺寸??

我想按行数,面板尺寸应自动增加。



使用cssclass autosize,但不会工作......

使用scrollbar =true但没有完成任务。



< asp:Panel ID =Panel3runat =serverstyle =border-style:solid; border-color:#006699;高度=305pxScrollBars =无>

< asp:GridView ID =GridView1runat =serverWidth =100%

AutoGenerateColumns =FalseBackColor =WhiteBorderColor =White

BorderStyle =RidgeBorderWidth =2pxCellPadding =3

DataKeyNames =ProductId CellSpacing =1GridLines =None>

How does ASP.NET panel Control can be made auto size according to the number GridView rows ??
I want as per the number of rows, the panel size should increase automatically.

What I have tried:

How does ASP.NET panel Control can be made auto size according to the number GridView rows ??
I want as per the number of rows, the panel size should increase automatically.

using cssclass autosize, but won't work out......
using scrollbar="true" but nothing getting done.

<asp:Panel ID="Panel3" runat="server" style="border-style: solid; border-color: #006699;" Height="305px" ScrollBars="None">
<asp:GridView ID="GridView1" runat="server" Width="100%"
AutoGenerateColumns="False" BackColor="White" BorderColor="White"
BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
DataKeyNames="ProductId" CellSpacing="1" GridLines="None">

推荐答案

只是不要设置Panel控件的大小,以便它根据大小调整大小儿童内容。在您的情况下,删除面板的高度属性。
Just don't set the the size of your Panel control so it will adapt the size based on the child contents. In your case, remove the Height property of your panel.


这篇关于ASP.NET面板控件如何根据gridview行自动调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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