[CLOSED] Scrolling using FitLayout / RowLayout / Panel - how to get it working?

  1. #1

    [CLOSED] Scrolling using FitLayout / RowLayout / Panel - how to get it working?

    So I have been trying to get some scrolling going, but I guess someone needs to explain to me how it works because its pretty far from obvious.

    This gets a scrollbar:

    <ext:FitLayout runat="server">
            <Items>
                <ext:Panel ID="Panel1" runat="server" AutoScroll="true">
                     <Items>
                                    <ext:Label runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label1" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label2" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label3" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label4" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label5" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label6" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label7" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label8" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                    <ext:Label ID="Label9" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                    </Items>
                </ext:Panel>
    </ext:FitLayout>
    this does not get a scrollbar:

    <ext:FitLayout runat="server">
            <Items>
                <ext:Panel ID="Panel1" runat="server" AutoScroll="true">
                    <Items>
                         <ext:RowLayout ID="RowLayout1" runat="server" Split="false">
                                <Rows>
                                  <ext:LayoutRow>
                                    <ext:Panel runat="server">
                                        <Items>
                                             <ext:Label runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label1" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label2" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label3" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label4" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label5" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label6" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label7" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label8" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                             <ext:Label ID="Label9" runat="server" Html="asd asd asd <br /> qwe qwe qwe <br /> fgh fgh fgh <br />"></ext:Label>
                                      </Items>
                                    </ext:Panel>
                                  </ext:LayoutRow>
                                </Rows>
                            </ext:RowLayout>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:FitLayout>
    My logic tells me that it should get scrollbars in both cases. What am I missing?
    Last edited by Daniil; Apr 06, 2011 at 10:20 AM. Reason: [CLOSED]
  2. #2
    Hi,

    It's a peculiarity of RowLayout.

    Please set up
    <ext:Panel runat="server" RowHeight="1" AutoScroll="true">
    for the Panel which contains Labels.
  3. #3
    ok, so the next question will then be:

    How do I make sure that I get a scrollbar in this scenario:

    <ext:FitLayout runat="server">
            <Items>
                <ext:Panel ID="Panel1" runat="server" AutoScroll="true">
                    <Items>
                           <ext:RowLayout ID="RowLayout1" runat="server" Split="false">
                               <Rows>
                                   <ext:LayoutRow>
                                       // Stuff and such
                                    </ext:LayoutRow>
                                    <ext:LayoutRow>
                                          // Stuff and such
                                    </ext:LayoutRow>
                                    <ext:LayoutRow>
                                        // Stuff and such
                                    </ext:LayoutRow>
                                   // etc etc etc
                                </Rows>
                            </ext:RowLayout>
                    </Items>
                </ext:Panel>
            </Items>
    </ext:FitLayout>
    The thing is I want the "Panel1" to make all the content AutoScroll. I do not want each row to have a scrollbar, but the whole thing.

    Im not sure how to do that...
  4. #4
    I understand, you need scrolling for the Panel that contains RowLayout, isn't that so?

    If so, unfortunately, RowLayout doesn't support scrolling.

    What about the following layout?

    Example
    <ext:Panel runat="server" Height="300" AutoScroll="true">
        <Items>
            <ext:Panel runat="server" Title="1" Height="400">
                ...
            </ext:Panel>
            <ext:Panel runat="server" Title="2" Height="400">
                ...
            </ext:Panel>
        </Items>
    </ext:Panel>
  5. #5
    Thanks again. That works.

    The funny thing is that I try numerous different ways of layout:ing. I add, remove and try out different panels, RowLayouts etc to get it right, and in the end I ended up with the RowLayout.

    But in accordance to your suggestion, it works just as well with panels only.

    Thanks for the help, once again =)
  6. #6
    Please note that layout managers that manages items height breaks vertical scrolling. The same situation with width and horizontal scrolling.
  7. #7
    Do you mean if you set the Height or Width property? Or AutoWidth/AutoHeight?
  8. #8
    No.

    I mean that, for example, a Panel with FitLayout can't have vertical and horizontal scrolling, because it fits height and width of child widget to parent's width and height.
  9. #9
    I'll just add in here, if it's not already obvious...

    The auto scrolling functionality of some layouts (hbox, vbox, column) is quirky in v1. We've attempted to work-around some of these problems, but they're difficult problems to fix 100% successfully.

    We're hoping/expecting the next major Ext.NET release (v2) will help solve some of these inconsistencies.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 7
    Last Post: Feb 01, 2011, 11:00 AM
  2. Full Height for parent Panel when using RowLayout
    By henricook in forum 1.x Help
    Replies: 3
    Last Post: Jun 07, 2010, 12:41 PM
  3. GridPanel in fitlayout panel, code-behind
    By Ciaro in forum 1.x Help
    Replies: 3
    Last Post: Jan 19, 2010, 5:36 PM
  4. Replies: 0
    Last Post: Dec 08, 2009, 1:57 AM
  5. GridPanel resize in Panel->Fitlayout
    By Washburn in forum 1.x Help
    Replies: 3
    Last Post: Oct 27, 2008, 5:26 PM

Tags for this Thread

Posting Permissions