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
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)});
}