Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi (again!), ok i have a "display section" in the top half of my page and a TreeView control in the other half, when nodes are checked on it, and a "Save" button is clicked, i go off and do some processing but need to display the checked nodes to the user...

 

Problem is i want to be able to limit the size of the screen this takes up and ideally for some vertical scrollbars to appear so they can scroll through the list, thus NOT pushing the treeview out of view. I HAVE got this working fine with my TreeView by giving it a height percentage and then a STYLE="POSITION: absolute", which means if there are loads of nodes, scrollbars appear....

 

Any good tricks, or controls that will allow me to do this?

 

Many thanks

 

Axum

Posted

There are two easy ways to control the size of displayed items on a page.

 

1) Place <DIV> tags around your table or cell that you don't want to grow. Example:

 

<DIV style="Overflow: auto; height: 100; width: 200">

<TABLE id="table1" width="100%" height="100%">

<TR>

<TD></TD>

</TR>

</TABLE>

</DIV>

 

The example above will "trap" your table within the DIV by never allowing it to grow beyond the height and width parameters you set to fit your page. If it does, scroll bars appear to handle the overflow. Once you have done this, you can set the scroll bars in the "Overflow" event to always appear or display as needed, etc. Also, the horizontal and vertical scroll bars work independently of each other, so that may help in your formatting.

 

2) Input an HTML panel control within the cell or table you are using. You can set the properties of the panel similar to the DIV, but with a panel, you can call it in your code and control it just as you would any other control. You can fill the panel with whatever you want. Any property you assign the panel gets inherited to all nested controls (similar to grouping). You make the panel visible=false, everything within the panel is invisible, etc.

 

 

Hope that helps. Once you get used to this, you can literally set anything within them - datagrids, forms, etc. when you need to conserve space. If you need anything else or if this doesn't help, let me know. There are other, more complicated ways, but this would be the easiest way out.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...