Stop dropdown closing when clicking OK on filter box

5 posts, 0 answers
  1. Shaun
    Shaun avatar
    37 posts
    Member since:
    Sep 2012

    Posted 13 May 2015 Link to this post

    Hi,

    I have a multicol combo with 5 columns and I have enabled filtering on each column :

    multiColumnComboElement.EditorControl.EnableFiltering = true;

    multiColumnComboElement.EditorControl.ShowHeaderCellButtons = true;

     

    The issue I'm having is that when a user clicks on the OK button in the available filter list (see attached image) the main dropdown closes.

    What I would like to happen is when the user clicks OK on the filter button the main drop down is still available but only showing the matching rows.

    So for example and using the attached image as reference, if the user checks 19, 21, 30 and clicks OK the main dropdown remains open so the user can select from the filtered rows.

    Not explaining this very well, but hope you get the idea.

    I have managed to create a work around but its not ideal, basically on dropdown close I cancel if selectedIndex < 0, on dropdownopening I set selectedindex = -1.

    Thanks for your help.

     Cheers

     

    Shaun

     

     

     

  2. Shaun
    Shaun avatar
    37 posts
    Member since:
    Sep 2012

    Posted 13 May 2015 Link to this post

    Hi,

     Something went wrong trying to post message above, will try and attach image again.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Shaun
    Shaun avatar
    37 posts
    Member since:
    Sep 2012

    Posted 13 May 2015 Link to this post

    Third time lucky hopefully....

    If the image does not load then maybe text in original post is enough for you to go on.

  5. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 14 May 2015 Link to this post

    Hi Shaun,

    Thank you for contacting us. 

    You can subscribe to the PopupOpening and PopupClosed event of the popup and use a variable to indicate if the popup is open. This way you can cancel the close when it is:
    void EditorControl_FilterPopupInitialized(object sender, Telerik.WinControls.UI.FilterPopupInitializedEventArgs e)
    {
        e.FilterPopup.PopupOpening -= FilterPopup_PopupOpening;
        e.FilterPopup.PopupClosed -= FilterPopup_PopupClosed;
        e.FilterPopup.PopupOpening += FilterPopup_PopupOpening;
        e.FilterPopup.PopupClosed += FilterPopup_PopupClosed;
    }
     
    bool isOpened = false;
     
    void FilterPopup_PopupClosed(object sender, Telerik.WinControls.UI.RadPopupClosedEventArgs args)
    {
        isOpened = false;
    }
     
    void FilterPopup_PopupOpening(object sender, CancelEventArgs args)
    {
        isOpened = true;
    }
     
    void MultiColumnComboBoxElement_PopupClosing(object sender, Telerik.WinControls.UI.RadPopupClosingEventArgs args)
    {
        args.Cancel = isOpened;
    }

    I hope this helps. Should you have any other questions do not hesitate to ask.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Shaun
    Shaun avatar
    37 posts
    Member since:
    Sep 2012

    Posted 14 May 2015 in reply to Dimitar Link to this post

    Hi Dimitar,

    That work a treat, thank for your help.

    Cheers

    Shaun

Back to Top
UI for WinForms is Visual Studio 2017 Ready