I would like to contain a datgrid control in a box with a vertical scrollbar.
Is this possible and if so how?
Thanks in Advance
Printable View
I would like to contain a datgrid control in a box with a vertical scrollbar.
Is this possible and if so how?
Thanks in Advance
Box? What kind of box?
Basically I dont want the controls to expand.
I want them to be constrained to a particular size. If the control needs to be larger than I would want scroll bars to appear.
Use a stylesheet with the following CSS CLASS:
.restrictHeight{height:250px; overflow: scroll}
Wrap the DIV with and ASP:Panel and set the CSS-CLASS of the panel to restrictHeight
There's probably quite a few ways to do this, but I often do things like this by creating my content (such as your grid) on a separate document a reference it in an IFrame. It just helps me keep separate items "separate". But Lord_Rat's method is probably a bit more proper.
The problem with IFRAMEs are that you now limit your customer base to IE only.
In general, I tend not to care much about non-IE people, but that's because I create solutions for the Intranet, not the Internet and so I know who my customers are and I have the liberty of telling them that IE is the only way.
On the occasion that I create pages for external use, I try to make sure that I don't program IE only. The advantage to .Net is that it will do this for you, if you use it right. That means no IFRAMEs (or DIV's or LAYERs).