|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView ScrollBarbut also properly displays its scroll bars? I have a webform within which the first table has a width of 100%. That way, if the user resizes the browser, the page expands and contracts to fit the exact width of the page. Now, if I put a gridview control on the page with a width of 100%, that works good too. The gridview expands and contracts to the size width of the page. The problem is then the gridview becomes TALLER that the size of the browser window. I never want this to happen. I want to incorporate my own scroll bars for the gridview so that the gridview entries become scrollable once the height of the gridview his some certain maximum. I can kind of get this effect when i place the gridview into a lable with a style tag like ... <asp:Label ID="lblGridViewCompany" CssClass="hide" Style="overflow-y:scroll; overflow-x:visible" Height="150" width="100%" runat="server"> With this technique, the grid scroll once i hit 150, but i can't see the scroll bars. They are pushed off too far to the right. First off, i would recommend not using a label to wrap the grid.
Use a <div> tag (or maybe the asp:panel, which already has scrollbars built in available as a property). Show quoteHide quote "Ben Schumacher" <bschumac***@navegate.com> wrote in message news:uw%23x$$0rGHA.2256@TK2MSFTNGP03.phx.gbl... > Anyone have a good solution to have an gridcontrol that has a width of > 100%, but also properly displays its scroll bars? > > I have a webform within which the first table has a width of 100%. That > way, if the user resizes the browser, the page expands and contracts to > fit the exact width of the page. Now, if I put a gridview control on the > page with a width of 100%, that works good too. The gridview expands and > contracts to the size width of the page. The problem is then the gridview > becomes TALLER that the size of the browser window. I never want this to > happen. I want to incorporate my own scroll bars for the gridview so that > the gridview entries become scrollable once the height of the gridview his > some certain maximum. I can kind of get this effect when i place the > gridview into a lable with a style tag like ... > > <asp:Label ID="lblGridViewCompany" CssClass="hide" > Style="overflow-y:scroll; overflow-x:visible" Height="150" width="100%" > runat="server"> > > With this technique, the grid scroll once i hit 150, but i can't see the > scroll bars. They are pushed off too far to the right. > > Ok, but the end html result will be the same no matter what server control i
use. I'm sure a asp:Panel and asp:Label result in the same html output. I don't really care what control i use. Please understand that I'm not having trouble getting the scroll bars to display. My problem is that the gridview needs to have a width of 100%. As a result, when the scroll bars become active or necssary, the gridview's width of 100% is not allowing them scrollbars to display becuse it is taking up that space. How do you make scrollbars visible for a gridview that has a width of 100% of the webform??? Show quoteHide quote "Arthur Dent" <hitchhikersguideto-n***@yahoo.com> wrote in message news:O%23ugea1rGHA.2256@TK2MSFTNGP03.phx.gbl... > First off, i would recommend not using a label to wrap the grid. > Use a <div> tag (or maybe the asp:panel, which already has scrollbars > built in available as a property). > > "Ben Schumacher" <bschumac***@navegate.com> wrote in message > news:uw%23x$$0rGHA.2256@TK2MSFTNGP03.phx.gbl... >> Anyone have a good solution to have an gridcontrol that has a width of >> 100%, but also properly displays its scroll bars? >> >> I have a webform within which the first table has a width of 100%. That >> way, if the user resizes the browser, the page expands and contracts to >> fit the exact width of the page. Now, if I put a gridview control on the >> page with a width of 100%, that works good too. The gridview expands and >> contracts to the size width of the page. The problem is then the >> gridview becomes TALLER that the size of the browser window. I never >> want this to happen. I want to incorporate my own scroll bars for the >> gridview so that the gridview entries become scrollable once the height >> of the gridview his some certain maximum. I can kind of get this effect >> when i place the gridview into a lable with a style tag like ... >> >> <asp:Label ID="lblGridViewCompany" CssClass="hide" >> Style="overflow-y:scroll; overflow-x:visible" Height="150" width="100%" >> runat="server"> >> >> With this technique, the grid scroll once i hit 150, but i can't see the >> scroll bars. They are pushed off too far to the right. >> >> > > Actually, an asp:label renders as a span, and an asp:panel renders as a div.
Also, i wouldnt count on the label server control not necessarily mucking with its contents. Divs are usually the more common approacg to making scrolling areas, not spans. Do something like the following (not exact code) <html> <form id=form1 runat=server> <table style="height: 100%; width: 100%"> <tr> <td><asp:panel id=pnlScroll runat=server width="100%" height="100%" scrollbars="Both"> <asp:gridview> ... </asp:gridview> </asp:panel></td> </tr> </table> </form> </html> That should get you what you want. Show quoteHide quote "Ben Schumacher" <bschumac***@navegate.com> wrote in message news:%23uhSkg1rGHA.1140@TK2MSFTNGP05.phx.gbl... > Ok, but the end html result will be the same no matter what server control > i use. I'm sure a asp:Panel and asp:Label result in the same html output. > I don't really care what control i use. Please understand that I'm not > having trouble getting the scroll bars to display. My problem is that the > gridview needs to have a width of 100%. As a result, when the scroll bars > become active or necssary, the gridview's width of 100% is not allowing > them scrollbars to display becuse it is taking up that space. How do you > make scrollbars visible for a gridview that has a width of 100% of the > webform??? > > > "Arthur Dent" <hitchhikersguideto-n***@yahoo.com> wrote in message > news:O%23ugea1rGHA.2256@TK2MSFTNGP03.phx.gbl... >> First off, i would recommend not using a label to wrap the grid. >> Use a <div> tag (or maybe the asp:panel, which already has scrollbars >> built in available as a property). >> >> "Ben Schumacher" <bschumac***@navegate.com> wrote in message >> news:uw%23x$$0rGHA.2256@TK2MSFTNGP03.phx.gbl... >>> Anyone have a good solution to have an gridcontrol that has a width of >>> 100%, but also properly displays its scroll bars? >>> >>> I have a webform within which the first table has a width of 100%. That >>> way, if the user resizes the browser, the page expands and contracts to >>> fit the exact width of the page. Now, if I put a gridview control on >>> the page with a width of 100%, that works good too. The gridview >>> expands and contracts to the size width of the page. The problem is >>> then the gridview becomes TALLER that the size of the browser window. I >>> never want this to happen. I want to incorporate my own scroll bars for >>> the gridview so that the gridview entries become scrollable once the >>> height of the gridview his some certain maximum. I can kind of get this >>> effect when i place the gridview into a lable with a style tag like ... >>> >>> <asp:Label ID="lblGridViewCompany" CssClass="hide" >>> Style="overflow-y:scroll; overflow-x:visible" Height="150" width="100%" >>> runat="server"> >>> >>> With this technique, the grid scroll once i hit 150, but i can't see the >>> scroll bars. They are pushed off too far to the right. >>> >>> >> >> > >
WebForm UserControl ?s
Custom Server Control ItemDataBound fires for header only ATTN MS: GridView improvements Require text entry - only if radio button checked GridViewRow FindControl failing Problem with HTML in ASP.Net App asp:menu dynamichoverstyle backcolor does not work.. Expandable Section gridview hyperLinkField |
|||||||||||||||||||||||