Completed
Last Updated: 03 Sep 2018 07:46 by Dimitar
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 11 Sep 2017 11:16
Category: GridView
Type: Feature Request
1
FIX. RadGridView - canceling the FilterPopup.PopupOpening makes the filter button highlighted
To reproduce:

public RadForm1()
{
    InitializeComponent();

    this.radGridView1.EnableFiltering = true;
    this.radGridView1.ShowHeaderCellButtons = true;

    this.radGridView1.FilterPopupRequired += radGridView1_FilterPopupRequired; 
}

private void radGridView1_FilterPopupRequired(object sender, Telerik.WinControls.UI.FilterPopupRequiredEventArgs e)
{
    e.FilterPopup.PopupOpening -= FilterPopup_PopupOpening; 
    e.FilterPopup.PopupOpening += FilterPopup_PopupOpening; 
}

private void FilterPopup_PopupOpening(object sender, CancelEventArgs args)
{
    args.Cancel = true;
}

Workaround: either set the ShowHeaderCellButtons property to false or closed the popup immediately after it is opened.

private void radGridView1_FilterPopupRequired(object sender, Telerik.WinControls.UI.FilterPopupRequiredEventArgs e)
{
    e.FilterPopup.PopupOpening -= FilterPopup_PopupOpening; 
    e.FilterPopup.PopupOpening += FilterPopup_PopupOpening; 
}

private void FilterPopup_PopupOpening(object sender, CancelEventArgs args)
{ 
    RadListFilterPopup popup = sender as RadListFilterPopup;
    popup.PopupOpened -= popup_PopupOpened;
    popup.PopupOpened += popup_PopupOpened;
}

private void popup_PopupOpened(object sender, EventArgs args)
{
    RadListFilterPopup popup = sender as RadListFilterPopup;
    popup.ClosePopup(RadPopupCloseReason.Mouse);
}

Attached Files:
0 comments