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

How to disable expanding/collapsing/selecting

1 Answer 235 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Kirk Quinbar
Top achievements
Rank 1
Kirk Quinbar asked on 10 Jan 2011, 03:42 PM
In the attached images you will see how we are using the radpanelbar as a grid of sorts for editing records. we have a few fields in the item template so when an item is expanded, you can see the fields and then if someone presses the edit button, you can then edit the fields. what i want to do is during edit mode (which is represented by a boolean) prevent the user from either selecting any other panelbaritem or expanding any other panelbaritem (which would automatically collapse the currently edited one. in the second image you can see some code we had tried in the codebehind, but came across an endless loop if we have e.handled=false in the preview_collapsed event.

I saw that i can set a property called IsExpandOnSingleClickEnabled in xaml which does seem work to prevent, expanding/collapsing of panelbaritems, but didnt prevent selecting other panelbar items. basically what i want to do is disable all user actions on the panelbar itself while still allowing users to edit information that is in the currently selected panelbaritem expanded section. Is this possible and what would be the best way to accomplish this?

Kirk

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 13 Jan 2011, 10:43 AM
Hello Kirk Quinbar,

I prepared a sample for you that demonstrates a possible approach. Basically, I play with the IsEnabled property of the RadPanelBarItem and don`t use PreviewExpanded and PreviewCollapsed events in order to avoid cycles, propagating of invocations and etc. Please examine the solution and let me know if it fits in your scenario. It should be easy to modify it , so please let me know if you need further assistance.

Kind regards,
Petar Mladenov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
PanelBar
Asked by
Kirk Quinbar
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or