6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 07 Sep 2012, 04:21 AM
Hi Andrew,
Try setting Expanded property of RadPanelItem to true to achieve your scenario.Here is the sample code that I tried.
ASPX:
Hope this helps.
Regards,
Princy.
Try setting Expanded property of RadPanelItem to true to achieve your scenario.Here is the sample code that I tried.
ASPX:
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
runat
=
"server"
>
<
Items
>
<
telerik:RadPanelItem
Text
=
"RadPanelItem1"
>
<
Items
>
................
</
Items
>
</
telerik:RadPanelItem
>
<
telerik:RadPanelItem
Text
=
"RadPanelItem2"
Expanded
=
"true"
>
<
Items
>
................
</
Items
>
</
telerik:RadPanelItem
>
<
telerik:RadPanelItem
Text
=
"RadPanelItem3"
>
<
Items
>
................
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
Hope this helps.
Regards,
Princy.
0
Andrew
Top achievements
Rank 1
answered on 07 Sep 2012, 09:48 AM
Can't do that the items are created dynamically by binding the panelbar to a datasource. Which is actually a sitemap from sitefinity.
0
Princy
Top achievements
Rank 2
answered on 07 Sep 2012, 10:07 AM
Hi Andrew,
Try the following code to achieve your scenario.
C#:
Hope this helps.
Regards,
Princy.
Try the following code to achieve your scenario.
C#:
RadPanelBar1.Items[1].Expanded =
true
;
Hope this helps.
Regards,
Princy.
0
Andrew
Top achievements
Rank 1
answered on 09 Sep 2012, 05:24 AM
That worked.
I put in in the ItemBound Event:
Expends only the first level which works well for me.
I would in fact like to disable to possibility of the end user collapsing that level.
Is there a property on the item i can set to do so?
I put in in the ItemBound Event:
protected
void
RadPanelBar1_DataBound(
object
sender, EventArgs e)
{
foreach
(RadPanelItem myItem
in
(((RadPanelBar)sender).Items))
{
myItem.Expanded =
true
;
}
}
I would in fact like to disable to possibility of the end user collapsing that level.
Is there a property on the item i can set to do so?
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Sep 2012, 06:59 AM
Hi Andrew,
Try setting PreventCollapse property of RadPanelItem to true achieve your scenario.
C#:
Regards,
Princy.
Try setting PreventCollapse property of RadPanelItem to true achieve your scenario.
C#:
foreach
(RadPanelItem myItem
in
(RadPanelBar1.Items))
{
myItem.Expanded =
true
;
myItem.PreventCollapse =
true
;
}
Regards,
Princy.
0
Andrew
Top achievements
Rank 1
answered on 10 Sep 2012, 09:21 AM
Thanks that works.