How to disable expanding/collapsing/selecting

2 posts, 0 answers
  1. Kirk Quinbar
    Kirk Quinbar avatar
    48 posts
    Member since:
    Nov 2007

    Posted 10 Jan 2011 Link to this post

    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?

  2. Petar Mladenov
    Petar Mladenov avatar
    2986 posts

    Posted 13 Jan 2011 Link to this post

    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>>
Back to Top