Determining when a control is scrollable

A

Ashish Kaila

Hi All,
Is there a way to tell when a control is scrollable ? For example suppose we
have a table and we want height no more than 100%. If you are adding
controls in new rows, you want to handle scrolling than to expand table
beyond the page length. Is there a way by which this can be achieved ?
Thanks
Ashish
 
W

WALDO

You can nest your table in a DIV and have it set to a fixed width/height
to enable it to scroll, but I don't beleive there's a way to tell if it
is or not.

HTML:
<DIV
style="width:400px;height:200px;background-color:red;overflow:scroll;">
<TABLE style="width: 276px;height: 500px;">
<TR>
<TD width="100%" height="100% bgcolor="green">This table should have
scrolling around the contents.
</TR>
</TABLE>
</DIV>


You can insert the DIV by overriding Render

[VB.Net]
Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
writer.Write("<DIV
style=""width:400px;height:200px;background-color:red;overflow:scroll;""[QUOTE]
")[/QUOTE]
MyBase.Render(writer)
writer.Write("</DIV>")
End Sub






Sometimes the greatest solutions come from the simplest logic.
Being told no is merely the incentive to do it anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top