Simple Way to Stack Custom User Controls Inside of a Scrollable Panel?

1 Answer 33 Views
Panel
Sean
Top achievements
Rank 1
Sean asked on 30 Jun 2022, 01:34 PM

Is there some simple method to stacking custom controls inside of a radpanel (or other element)?  I have a Radpanel that I want to add strips of custom FileUploadRecord Controls to that vertically stack.

I still need to wrap my head around docking, floating, anchoring, position, auto size, etc, but my current method of adding is:

pnlFiles.Controls.Add(new FileUploadRecord());

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Jun 2022, 01:48 PM

Hi, Sean,

In order to stack controls in a RadPanel, it is suitable to Dock each of these controls to Top for example. Thus, you will achieve the stacking effect.

The following code snippet illustrates in a better what I mean: 

            UserControl uc1 = new UserControl();
            uc1.Dock = DockStyle.Top;
            UserControl uc2 = new UserControl();
            uc2.Dock = DockStyle.Top;
            RadPanel p = new RadPanel();
            p.Controls.Add(uc1);
            p.Controls.Add(uc2);

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Panel
Asked by
Sean
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or