Programmatically cancel reorder mode?

8 posts, 0 answers
  1. Philip
    Philip avatar
    7 posts
    Member since:
    May 2014

    Posted 01 Jan 2015 Link to this post

    The user puts the DataBoundListBox into reorder mode by pressing & holding on an item.

    I also have an app bar button that puts the control into checkbox mode if the user wants to delete items from the list. It is possible, although ugly, to have the control in reorder mode and checkbox mode at the same time. What I'd like to do is tell the control to come out of reorder mode before enabling checkbox mode. Is there a way to do that?

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 05 Jan 2015 Link to this post

    Hi Philip,

    While this behavior is not available out of the box, you can achieve it by adding the following code before showing the checkboxes:

    listBox.FindChildByType<RadWindow>().IsOpen = false;


    Regards,
    Tsvyatko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Philip
    Philip avatar
    7 posts
    Member since:
    May 2014

    Posted 05 Jan 2015 in reply to Tsvyatko Link to this post

    Hi

    Thanks for the suggestion. I have a couple of follow-up questions:

    1. What should listBox be? I've tried using the DataBoundListBox control instance but it doesn't have a method FindChildByType.

    2. Where is RadWindow defined? VS2013 doesn't offer a Resolve option so it doesn't know anything about it.

    Just to clarify, this is for WP8.1 XAML, although I think that is the only platform this control is supported on, but I realised I hadn't stated that explicitly in my original post.

    Regards

    Philip
  4. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 05 Jan 2015 Link to this post

    Hello Philip,

    In order to use the extension method FindChildOfType you need to add this namespace: 
    using Telerik.Windows.Controls;

    In the code snippet listbox variable is RadDataBoundListBox instance

    Please excuse me for not clarifying this initially.

    Regards,
    Tsvyatko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Philip
    Philip avatar
    7 posts
    Member since:
    May 2014

    Posted 05 Jan 2015 in reply to Tsvyatko Link to this post

    Hi

    Sorry - this still isn't working for me.

    using Telerik.Windows.Controls; doesn't exist. I only have Charting, Core and UI under Telerik.

    Philip

  6. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 06 Jan 2015 Link to this post

    Hi Philip,

    Please excuse me for the misdirection. The code is applicable for WP8. For Windows Phone 8.1 you need to do the following:

     - Modify the template for RadDataBoundListBox and set IsLightDimissEnabled=false to its PART_ItemReorderPopup. This way you can end reorder mode only explicitly

     - In order to close the reorder mode you need to set Popup isOpen to false.


    I have prepared sample project demonstrating how to achieve this.




    Regards,
    Tsvyatko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Philip
    Philip avatar
    7 posts
    Member since:
    May 2014

    Posted 06 Jan 2015 in reply to Tsvyatko Link to this post

    Thank you.
  8. Philip
    Philip avatar
    7 posts
    Member since:
    May 2014

    Posted 06 Jan 2015 in reply to Tsvyatko Link to this post

    Thank you.
Back to Top