Hi,
I am using column UI filtering (AllowFiltering = True) with my SfDataGrid. I have the FilterPopupMode set to CheckBoxFilter and have disabled the sort panel (ShowSortPanel = False). When the filter UI is open I can detect its closure by setting a Boolean flag when clicking either the OK or Cancel buttons on the UI. This process enables me to keep the dropdown container that hosts the SfDataGrid open while the filter UI is displayed. This all works perfectly. The issue that I'm trying unsuccessfully to resolve is how to detect the filter UI 'closing' when the mouse is clicked outside of the UI, as doing so closes the UI. I need to ensure my Boolean flag variable is updated to be False when this occurs. The Boolean flag is set to True in the FilterPopupShowing event.
Is there a way to accomplish this?
WinForms 19.2.0.44
Windows 10
VB.Net (VS Studio 2019)
Regards
Jeremy
public Form1()
{
InitializeComponent();
sfDataGrid1.DataSource = new OrderInfoCollection().OrdersListDetails;
this.sfDataGrid1.FilterPopupShown += SfDataGrid1_FilterPopupShown;
}
private void SfDataGrid1_FilterPopupShown(object sender, Syncfusion.WinForms.DataGrid.Events.FilterPopupShownEventArgs e)
{
var toolstrip = (ToolStripDropDown)(e.Control as DataGridFilterControl).GetType().BaseType.GetField("filterPopup", System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.NonPublic).GetValue(e.Control as FilterControlBase);
toolstrip.Closed += Toolstrip_Closed;
}
private void Toolstrip_Closed(object sender, ToolStripDropDownClosedEventArgs e)
{
// Do your customizations here
} |
Mohanram,
Thanks for the quick reply. The snippet does indeed give me what I was after.
Thanks again.
Jeremy