All Products
Demos
Pricing
Services
Blogs
Docs & Support
Search
Shopping cart
Login
Contact Us
Get A Free Trial
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX Forum
/
PanelBar
/
Postback only when Expand?
Cancel
Telerik UI for ASP.NET AJAX
Resources
Buy
Try
Feed for this thread
3 posts, 0 answers
Raymond
24 posts
Member since:
Apr 2009
Posted 08 Sep 2009
Link to this post
Hi,
Is there a way to send a postback and do serverside code when the user expands the panel but no postback when the panel is collapsed. Now I use the event OnItemClick couse there are no OnExpand and OnCollapse but then there are allways a postback - no good.
On Expand I load stuff inside the panel but on collapse no such thing needs to be done.
/R
Shinu
17764 posts
Member since:
Mar 2007
Posted 09 Sep 2009
Link to this post
Hi Raymond,
Try the following approach to achieve the functionality.
ASPX:
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
OnClientItemClicking
=
"OnClientItemClicking"
OnClientItemExpand
=
"OnClientItemExpand"
runat
=
"server"
OnItemClick
=
"RadPanelBar1_ItemClick"
>
</
telerik:RadPanelBar
>
JavaScript:
<script type=
"text/javascript"
>
function
OnClientItemExpand()
{
__doPostBack(
'<%= RadPanelBar1.ClientID %>'
,
''
);
}
function
OnClientItemClicking(sender, args)
{
if
(args.get_item().get_expanded())
{
args.set_cancel(
true
);
args.get_item().set_expanded(
false
);
}
}
</script>
-Shinu.
Raymond
24 posts
Member since:
Apr 2009
Posted 09 Sep 2009
Link to this post
Works great!
Thanks Shinu.
/R
Back to Top
Close