This is a migrated thread and some comments may be shown as answers.

Radpanelbar expand collapse issue

3 Answers 181 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 03 Jul 2013, 06:23 PM
Hi,
I am using radpanel bar. when i click on the panelbar item if it is open then it should be closed and next panel item should be loaded automatically , if it is closed then expand and collapse all other expanded panel items







Thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
A2H
Top achievements
Rank 1
answered on 06 Jul 2013, 01:27 AM
Hello,

Please try the following

1) Set the below two properties of Panel bar
ExpandMode="SingleExpandedItem" AllowCollapseAllItems="true"

2) call the  Panelbar's OnClientItemClicked event with the below code

function OnClientItemClicked(sender, args) {
           if (args.get_item().get_expanded() == true) {
                args.get_item().set_expanded(true);
            }
            else {
                args.get_item().get_nextSibling().set_expanded(true);
                args.get_item().set_expanded(false);
            }
        }

Let me know if you are facing any issues.

Thanks,
A2H
0
Dhamodharan
Top achievements
Rank 1
answered on 10 Jul 2013, 07:38 AM
Hi A2H,
It works perfect. but when i click on the expand button of last panel item in panel bar, all Panelitem get Collapsed. Can u provide a solution for that issue.



Thanks
0
A2H
Top achievements
Rank 1
answered on 10 Jul 2013, 02:11 PM
Hi Dhamodharan,

I think you want to expand the previous panel item when you select the last panel item.If that is the case use the below javascript

function OnClientItemClicked(sender, args) {
           if (args.get_item().get_expanded() == true) {
               args.get_item().set_expanded(true);
           }
           else {
               if (args.get_item().get_isLast()) {
                   args.get_item().get_previousSibling().set_expanded(true);
                   args.get_item().set_expanded(false);
               }
               else {
                   args.get_item().get_nextSibling().set_expanded(true);
                   args.get_item().set_expanded(false);
               }
           }
       }

If you want a functionality other than this, please explain it here. I will help you to implement that.

Thanks,
A2H
Tags
PanelBar
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
A2H
Top achievements
Rank 1
Dhamodharan
Top achievements
Rank 1
Share this question
or