Hello Telerik Team,
I have a question about the radcollapsiblepanel. When
I create a new collapsiblepanel programmatically the isExpanded property is not
working.
01.
public partial class Form1 : Form
02.
{
03.
public Form1()
04.
{
05.
InitializeComponent();
06.
RadCollapsiblePanel pn = new RadCollapsiblePanel();
07.
pn.Dock = DockStyle.Left;
08.
pn.ExpandDirection = RadDirection.Right;
09.
10.
pn.IsExpanded = false; <------ Is not working
11.
12.
this.Controls.Add(pn);
13.
14.
}
15.
}
Is there something that I’m missing?
Kindest
regards,
Arif
20 Answers, 1 is accepted
Thank you for writing.
When you are initializing the control this way in the forms constructor it is still not loaded and this is why it is not collapsed. In this case you can either call the LoadElementTree method before setting the IsExpanded property or just set this property in the form's Load event:
RadCollapsiblePanel pn =
new
RadCollapsiblePanel();
public
Form1()
{
InitializeComponent();
pn.Dock = DockStyle.Left;
pn.ExpandDirection = RadDirection.Right;
pn.LoadElementTree();
pn.IsExpanded =
false
;
this
.Controls.Add(pn);
}
private
void
Form1_Load(
object
sender, EventArgs e)
{
pn.IsExpanded =
false
;
}
Also I have noticed that you have posted identical post and we have deleted it in order to avoid such duplicate posts in our forum.
I hope this helps. Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Telerik
I would like to RadCollapsible panel be collapsed when the form is loaded and showing for the first time.
IsExpanded property just collapsed the already spread RadCollapsible control on the form.
Regards,
Abbas
Thank you for writing.
The animations slow down the collapse process and this is why the panel is still visible when the form is shown. You can disable the animation when the form is loaded and the panel will be collapsed when the form is started:
RadCollapsiblePanel pn =
new
RadCollapsiblePanel();
public
RadForm1()
{
InitializeComponent();
pn.Dock = DockStyle.Left;
pn.ExpandDirection = RadDirection.Right;
pn.EnableAnimation =
false
;
pn.LoadElementTree();
pn.IsExpanded =
false
;
this
.Controls.Add(pn);
pn.EnableAnimation =
true
;
}
Please let me know if there is something else I can help you with.
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
The scrollbars should appear automatically if the control is docked. I have attached an example that shows this.
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
I created the project at design time. There is no explicit code for the scrollbar. Once there is a control that is outside of the visible area the scroll will appear. I am not sure why this is not working on your side. Would it be possible to open a ticket and attach the code from your form? This way we will be able to properly investigate this and determine why this is not working.
I am looking forward to your reply.
Dimitar
Progress Telerik
RadImageButtonElement btnimage = new RadImageButtonElement
{
Image =newImage,
Size=new Size(20,20)
};
radCollapsiblePanel1.CollapsiblePanelElement.HeaderElement.Children.Insert(0, btnimage);
I am glad that the problem you were facing is now resolved. I have noticed that you have posted identical questions in multiple forum threads. We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.
Thank you for your understanding.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
I have the following menu header items (rad collapsible panel header) in "pictuer1".
I use the following property to set alignment :
radCollapsiblePanel1.CollapsiblePanelElement.StretchVertically = true;
radCollapsiblePanel1.CollapsiblePanelElement.HeaderElement.ElementSpacing = 15;
Problem :
but when I increase the size of screen the space between icons also increase like pictuer2
my question :
I need to make the menu icon fixed on top and the size between other icons is fixed when I increase the screen size .
Instead of setting the AutoSize and Size just set the margin. You can leave the ElementSpacing as well. For example:
RadImageButtonElement btnimage =
new
RadImageButtonElement();
btnimage.Image = newImage;
btnimage.Margin =
new
Padding(0, 15, 0, 15);
btnimage.StretchVertically =
false
;
radCollapsiblePanel1.CollapsiblePanelElement.HeaderElement.Children.Insert(0, btnimage);
I hope this helps. Should you have any other questions do not hesitate to ask.
Dimitar
Progress Telerik
In my case I set VerticalHeaderAlignment to center .
radCollapsiblePanel1.CollapsiblePanelElement.HeaderElement.VerticalHeaderAlignment= RadVerticalAlignment.Center;
my question :
I need only the first element of header (hamburger menu) on top and still fixed without padding change because with padding it's will change with each size , I need it fixed .
If I understand correctly you want the collapse/expand button to be at the top and the other buttons to be centered. This can be achieved by manually arranging the items. I have attached a small sample project that shows this. What I have done is to put the buttons in a StackLayoutElement, this element will be centered later in the ArrangeOverride method.
Let Me know how this works for you.
Regards,
Dimitar
Progress Telerik
Could you send me the attachment of the sample project.
regards .
There was an issue with our system, you should see the attachment at the end of the previous post now.
Regards,
Dimitar
Progress Telerik