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

Stop dropdown closing when clicking OK on filter box

4 Answers 85 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 13 May 2015, 09:36 PM

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

 

 

 

4 Answers, 1 is accepted

Sort by
0
Shaun
Top achievements
Rank 1
answered on 13 May 2015, 09:41 PM

Hi,

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

0
Shaun
Top achievements
Rank 1
answered on 13 May 2015, 09:46 PM

Third time lucky hopefully....

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

0
Dimitar
Telerik team
answered on 14 May 2015, 01:40 PM
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
0
Shaun
Top achievements
Rank 1
answered on 14 May 2015, 09:26 PM

Hi Dimitar,

That work a treat, thank for your help.

Cheers

Shaun

Tags
MultiColumn ComboBox
Asked by
Shaun
Top achievements
Rank 1
Answers by
Shaun
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or