Clicking on a parent-level RadPanelItem (or child-level RadPanelItem) initiates a click event - however if the Up Down Arrow Indicator on the right part of the RadPanelItem is clicked, no event is registered in the C# code-behind;
Any insight is appreciated;
12 Answers, 1 is accepted
The issue that you describe is a bug of the RadPanelBar that we are already aware of. It is logged in our internal system so we can fix it. Meanwhile I could suggest that you use jQuery to find the ExpandHandler by its css class (rpExpandHandle) and attach a click event.
Greetings,
Kate
the Telerik team
The issue is still not fixed but you can keep track on it in our PITS. Below you can find a link to the issue:
http://www.telerik.com/support/pits.aspx#/public/aspnet-ajax/5778
Regards,
Kate
the Telerik team
Our developers have already reviewed the issue with the Click event firing when the expand/collapse handler is clicked. Unfortunately such scenario would introduce a conflict of the behavior of the RadPanelBar control when the NavigateUrl property is used. If implemented for instance, a single click on the RadPanelItem expand/collapse handler will cause postback, expansion and at the same time navigation to another page. Therefore, we decided not to invoke the Click event when the expand/collapse handler is clicked. As a possible workaround, however, you can use the following javascript function that fires a click event when an expand/collapse handle is clicked:
<script type=
"text/javascript"
>
$telerik.$(document).ready(
function
() {
$telerik.$(
".rpExpandHandle"
).click(
function
() {
alert(1);
});
});
</script>
Kind regards,
Kate
the Telerik team
How to check, if any item is expanded or collapse.
so if item is collapse , we can expand it. if item is expand , we collapse it.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
<script type="text/javascript">
$telerik.$(document).ready(function() {
$telerik.$(".rpExpandHandle").click(function() {
var panelBar = $find("<%= radPanelBar.ClientID %>");
if ( ) { //if it is collapse then expand it otherwise collapse it.
panelBar.get_items().getItem(0).expand();
}
else {
panelBar.get_items().getItem(0).collapse();
}
});
});
</script>
</telerik:RadCodeBlock>
Thanks,
the telerik team
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
<script type="text/javascript">
var isExpanded = true;
$telerik.$(document).ready(function() {
$telerik.$(".rpExpandHandle").click(function() {
var panelBar = $find("<%= radPanelBar.ClientID %>");
if (isExpanded == true) {
panelBar.get_items().getItem(0).collapse();
isExpanded = false;
}
else {
panelBar.get_items().getItem(0).expand();
isExpanded = true;
}
});
});
</script>
</telerik:RadCodeBlock>
Thanks.
Muhammad Waseem
the telerik team
I have the same issue and I would like to use this javascript code Waseem (Animation Lover) proposed, but I wonder how to get the right RadPanelItem which was previously clicked, not only the first item.
Any help would be appreciated,
Thanks in advance.
Mary.
http://www.telerik.com/help/aspnet-ajax/panelbar-client-side-radpanelbaritem.html
http://demos.telerik.com/aspnet-ajax/panelbar/examples/clientside/clientsideevents/defaultcs.aspx
Thanks,
Muhammad Waseem
the Telerik team
You can achieve by using this below code.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
<script type="text/javascript">
var isExpanded = true;
$telerik.$(document).ready(function() {
$telerik.$(".rpExpandHandle").click(function() {
var panelBar = $find("<%= radPanelBar.ClientID %>");
if (isExpanded == true) {
panelBar.get_items().getItem(0).collapse();
isExpanded = false;
}
else {
panelBar.get_items().getItem(0).expand();
isExpanded = true;
}
});
});
</script>
</telerik:RadCodeBlock>
Mine Email is: emc_waseem@hotmail.com
if you still got any error. Email me.