Hi,
I have a RadPanelBar, when panel bar item was clicked it was causing postback:
in onclick event:
bool shouldRender = e.Item.Expanded = !e.Item.Expanded;
e.Item.PostBack = false; // yes, I don't want it to cause postback on consequent clicks
as you can see I was expanding it manually and depending on shouldRender variable I was doing databinding. This has been around for over 6 month and I was updating your controls regularly for this project. Today I got Q2 2012 and now this logic doesn't work anymore. What happens is that I can see that RadPanelBar first expands itself and then causes a postback, so first I see inner control's unbound view and then when postback completes - I see the data. I had to make a change to onclick event:
bool shouldRender = e.Item.Expanded;// = !e.Item.Expanded; <-- manually setting it *now* was collapsing, cause item was already expanded.
So my question is how to get back to original behavior when I don't want to item to expand itself on client side, but just cause a postback in collapsed state, I will do my stuff on server-side callback and set "expanded" property myself (as I was doing previously)?
Thank you!
P.S.: please check release notes for RadPanelBar for Q2 2012 - this should give you some hints in the "fixed" section.
I have a RadPanelBar, when panel bar item was clicked it was causing postback:
<
telerik:RadPanelBar
runat
=
"server"
ID
=
"pnlPageComponents"
Width
=
"100%"
OnClientLoad
=
"componentsPanelClientLoad"
onitemclick
=
"pnlAdditionalPageEntities_ItemClick"
OnClientItemClicked
=
"componentsPanelClientClicked"
>
<
CollapseAnimation
Type
=
"None"
></
CollapseAnimation
>
<
ExpandAnimation
Type
=
"None"
></
ExpandAnimation
>
<
Items
>
<
telerik:RadPanelItem
Height
=
"29px"
Text
=
"Components"
Value
=
"Components"
CssClass
=
"rpHeader1"
>
<
HeaderTemplate
>
<
span
class
=
"rpOut rpNavigation"
style
=
"cursor:pointer; border-left:1px solid #cccccc; border-right:1px solid #cccccc;"
>
<
span
class
=
"panelExpandIcon"
></
span
>
<
span
class
=
"rpText"
>
<
asp:Label
ID
=
"lblHeader0Components"
runat
=
"server"
></
asp:Label
>
<
asp:Label
ID
=
"lblItemStatus0Components"
CssClass
=
"pageContentComponentsEditorHeaderDescriptionBlue"
runat
=
"server"
></
asp:Label
>
</
span
>
</
span
>
</
HeaderTemplate
>
<
ContentTemplate
>
<
asp:UpdatePanel
ID
=
"UpdatePanelComponents"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
uc4:Components
ID
=
"pageComponentsList"
runat
=
"server"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
ContentTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
in onclick event:
bool shouldRender = e.Item.Expanded = !e.Item.Expanded;
e.Item.PostBack = false; // yes, I don't want it to cause postback on consequent clicks
as you can see I was expanding it manually and depending on shouldRender variable I was doing databinding. This has been around for over 6 month and I was updating your controls regularly for this project. Today I got Q2 2012 and now this logic doesn't work anymore. What happens is that I can see that RadPanelBar first expands itself and then causes a postback, so first I see inner control's unbound view and then when postback completes - I see the data. I had to make a change to onclick event:
bool shouldRender = e.Item.Expanded;// = !e.Item.Expanded; <-- manually setting it *now* was collapsing, cause item was already expanded.
So my question is how to get back to original behavior when I don't want to item to expand itself on client side, but just cause a postback in collapsed state, I will do my stuff on server-side callback and set "expanded" property myself (as I was doing previously)?
Thank you!
P.S.: please check release notes for RadPanelBar for Q2 2012 - this should give you some hints in the "fixed" section.