[CLOSED] CenterLayout / Scroll Issue

  1. #1

    [CLOSED] CenterLayout / Scroll Issue

    I'm trying to center a FormPanel in a scrolling container.

    Using the CenterLayout seems to break the scrolling behavior however.

    (This may have broken reciently as I am pretty sure this was working before)


    protected void Page_Init(object sender, EventArgs e)
    {
      Ext.Net.Container scrollContainer = new Ext.Net.Container{ AutoScroll= true };
      Ext.Net.FormPanel formPanel       = new Ext.Net.FormPanel{};
      for(int i=1; i<31; i++)
        formPanel.Items.Add(new Ext.Net.TextField{FieldLabel="Field"+i.ToString()});
      
      int test=2;
      switch(test)
      {
        case 1: // without centering, scroll works find
          scrollContainer.Items.Add(formPanel); 
          break;  
        
        case 2: // with centering, scroll doesn't work
          scrollContainer.Items.Add(new Ext.Net.CenterLayout{Items={formPanel}});
          break;
      }
      
      Ext.Net.BorderLayout borderLayout = new Ext.Net.BorderLayout();
      borderLayout.Center.Items.Add(scrollContainer);
      
      Form.Controls.Add(new Ext.Net.ResourceManager());
      Form.Controls.Add(new Ext.Net.Viewport{Items={borderLayout}});
    }
  2. #2

    RE: [CLOSED] CenterLayout / Scroll Issue

    Hi,

    I think that if you use CenterLayout then need move AutoScroll="true" to the FormPanel
  3. #3

    RE: [CLOSED] CenterLayout / Scroll Issue



    Vladimir;

    While this works, it is not a solution.

    If I put the AutoScroll on the panel inside the CenterLayout, then the scollbars appear in the middle of the page. I want the scrollbars to stay on the right, so AutoScroll needs to be outside the CenterLayout.
  4. #4

    RE: [CLOSED] CenterLayout / Scroll Issue

    Hi,

    Please set AutoHeight="true" for the FormPanel
    protected void Page_Init(object sender, EventArgs e)
            {
                Ext.Net.Container scrollContainer = new Ext.Net.Container { AutoScroll = true };
                Ext.Net.FormPanel formPanel = new Ext.Net.FormPanel { Width=Unit.Pixel(300), AutoHeight=true };
              for(int i=1; i<31; i++)
                formPanel.Items.Add(new Ext.Net.TextField{FieldLabel="Field"+i.ToString()});
              
              int test=2;
              switch(test)
              {
                case 1: // without centering, scroll works find
                  scrollContainer.Items.Add(formPanel); 
                  break;  
                
                case 2: // with centering, scroll doesn't work
                  scrollContainer.Items.Add(new Ext.Net.CenterLayout{Items={formPanel}});
                  break;
              }
              
              Ext.Net.BorderLayout borderLayout = new Ext.Net.BorderLayout();
              borderLayout.Center.Items.Add(scrollContainer);
              
              Form.Controls.Add(new Ext.Net.ResourceManager());
              Form.Controls.Add(new Ext.Net.Viewport{Items={borderLayout}});
            }
  5. #5

    RE: [CLOSED] CenterLayout / Scroll Issue



    Vladimir;

    Thanks, that did the trick.

Similar Threads

  1. [CLOSED] BorderLayout with scroll bar issue
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 13, 2012, 10:12 AM
  2. [CLOSED] Vertical scroll bar issue for treegrid
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 02, 2012, 8:30 AM
  3. Border Layout Scroll bar issue in ext.net
    By vs.mukesh in forum 1.x Help
    Replies: 3
    Last Post: Jun 24, 2010, 3:39 PM
  4. [CLOSED] CenterLayout issue w/CompositeFields
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 19, 2010, 1:17 PM
  5. GridPanel scroll issue in IE6
    By danielg in forum 1.x Legacy Premium Help
    Replies: 0
    Last Post: May 08, 2009, 11:18 AM

Posting Permissions