Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > Scrolling using WrapLayoutPanel

Not answered Scrolling using WrapLayoutPanel

Feed from this thread
  • David Storey avatar

    Posted on Nov 2, 2010 (permalink)

    Hi,

    Ive created a custom control using the telerik controls, which is based on the "business card" example provided in the demo code. 
    That is a RadControl that allows custom RadButtomElements to be added to it.  The RadButtonElements are stored in a WrapLayoutPanel.  However Im having difficulty getting scrolling to work properly.  Ive seen quite a few examples and threads about scrolling using the stacklayoutpanel, however I want to use the wraplayoutpanel to get better presentation, as each element is of variable size.  However using the wraplayout the scrollbars do not appear correctly.  At runtime it looks as though the viewport settings are calculated as if the viewport is a stacklayout not a wraplayout. 

    Any help will be greatly appreciated.

    Hopefully looking at this code will make a bit more sense...

    Version of Rad controls (WinForm) 2009.3.9.1203
     

    RadScrollViewer

     

    scrollViewer = new RadScrollViewer();
     
    Telerik.WinControls.UI.RadPanel radPanel1= new Telerik.WinControls.UI.RadPanel();

    this
    .Controls.Add(this.radPanel1);
    WrapLayoutPanel
    wrapLayout = new WrapLayoutPanel();

     

    wrapLayout.Orientation =

    Orientation.Horizontal;  

     

     

    scrollViewer.Viewport = wrapLayout;

     

    this.radPanel1.PanelElement.Children.Add(scrollViewer);  

    for(int i = 0 ; i < 100; i++)  

    {

    wrapLayout.Children.Add(

     

    new RadButtonElement() {Text = "Test" + i, Padding = new Padding(5), Margin = new Padding(2), Size = new Size(50,10)});  

    }

     

     

    Reply

  • Nikolay Nikolay admin's avatar

    Posted on Nov 11, 2010 (permalink)

    Hello David,

    Thank you for contacting us.

    I confirum that we have an issue in our RadScrollViewer. It will be addressed in one of our next releases. For the time being, you can use RadScrollablePanel in a combination with FlowLayoutPanel. To do this, you need to make some calculations concerning the size of the RadScrollablePanel, the FlowLayoutPanel and the content in the FlowLayoutPanel. For better understanding, I am attaching a sample project which demonstrates the approach. I hope that it will help you to continue working on your scenario.

    If you have additional questions, feel free to contact us.

    Regards,
    Nikolay
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > Scrolling using WrapLayoutPanel
Related resources for "Scrolling using WrapLayoutPanel"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]