/// <summary> /// The main method that applies a filter to the default data view /// </summary> public void ApplyFilter() { // Get the current filter and optionally call manual code so user can modify it, if necessary string previousFilter = FCurrentActiveFilter; try { FCurrentActiveFilter = FFilterPanelControls.GetCurrentFilter( FucoFilterAndFind == null || FucoFilterAndFind.IsCollapsed, (FucoFilterAndFind == null) ? TUcoFilterAndFind.FilterContext.None : FucoFilterAndFind.KeepFilterTurnedOnButtonDepressed, FFilterAndFindParameters.ShowFilterIsAlwaysOnLabelContext); FCallerFormOrControl.ApplyFilterString(ref FCurrentActiveFilter); if (FGrid.DataSource != null) { ((DevAge.ComponentModel.BoundDataView)FGrid.DataSource).DataView.RowFilter = FCurrentActiveFilter; } } catch (Exception) { MessageBox.Show(MCommonResourcestrings.StrErrorInFilterCriterion, MCommonResourcestrings.StrFilterTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); FCurrentActiveFilter = previousFilter; } FButtonPanel.UpdateRecordNumberDisplay(); SetRecordNumberDisplayProperties(); }
/// <summary> /// The main method that applies a filter to the default data view /// </summary> public void ApplyFilter() { // Get the current filter and optionally call manual code so user can modify it, if necessary string previousFilter = FCurrentActiveFilter; try { FCurrentActiveFilter = FFilterPanelControls.GetCurrentFilter( FucoFilterAndFind == null || FucoFilterAndFind.IsCollapsed, (FucoFilterAndFind == null) ? TUcoFilterAndFind.FilterContext.None : FucoFilterAndFind.KeepFilterTurnedOnButtonDepressed, FFilterAndFindParameters.ShowFilterIsAlwaysOnLabelContext); FCallerFormOrControl.ApplyFilterString(ref FCurrentActiveFilter); if (FGrid.DataSource != null) { ((DevAge.ComponentModel.BoundDataView)FGrid.DataSource).DataView.RowFilter = FCurrentActiveFilter; } } catch (EDBAccessLackingCoordinationException) { throw; } catch (Exception Exc) { TLogging.Log(String.Format(MCommonResourcestrings.StrErrorInFilterCriterion, Exc.ToString())); MessageBox.Show(String.Format(MCommonResourcestrings.StrErrorInFilterCriterion, Exc.Message) + Environment.NewLine + Environment.NewLine + AppCoreResourcestrings.StrSystemAdministratorLogFileHint, MCommonResourcestrings.StrErrorInFilterCriterionTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); FCurrentActiveFilter = previousFilter; } FButtonPanel.UpdateRecordNumberDisplay(); SetRecordNumberDisplayProperties(); }