Scrolling using WrapLayoutPanel

2 posts, 0 answers
  1. David Storey
    David Storey avatar
    7 posts
    Member since:
    Oct 2009

    Posted 02 Nov 2010 Link to this post


    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



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

    wrapLayout = new WrapLayoutPanel();


    wrapLayout.Orientation =




    scrollViewer.Viewport = wrapLayout;



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




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




  2. Nikolay
    Nikolay avatar
    1805 posts

    Posted 11 Nov 2010 Link to this post

    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.

    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
Back to Top