/// <summary> /// This method clears the text (or sets checkbox state to indeterminate) on all controls that have a clear button and a filter comparison. /// As the items are cleared an argumentPanelChange event will be fired. /// </summary> public void ClearAllDiscretionaryFilters() { List <TIndividualFilterFindPanel> SearchList; for (int i = 0; i < 2; i++) { if (i == 0) { SearchList = FStandardFilterPanels; } else { SearchList = FExtraFilterPanels; } for (int k = 0; k < SearchList.Count; k++) { TIndividualFilterFindPanel iffp = SearchList[k]; if (iffp.HasClearButton) { if ((iffp.FilterComparison == null) && !iffp.PanelControl.Tag.ToString().Contains(CommonTagString.FILTER_HAS_MANUAL_FILTER)) { continue; } if (!iffp.PanelControl.Enabled) { continue; } if (iffp.PanelControl is CheckBox) { ((CheckBox)iffp.PanelControl).CheckState = CheckState.Indeterminate; } else { iffp.PanelControl.Text = String.Empty; // For auto-complete combos we may not have done enough depending on whether they have an empty first item if ((iffp.PanelControl is TCmbAutoComplete) && (iffp.PanelControl.Text != String.Empty)) { TCmbAutoComplete cbo = (TCmbAutoComplete)iffp.PanelControl; cbo.SelectedIndex = -1; if (cbo.SelectedIndex == 0) { cbo.SelectedIndex = -1; } } } } } } }
private void AddCheckBoxFilter(string AnItemName) { TIndividualFilterFindPanel iffp; CheckBox chkAny = new CheckBox(); chkAny.Name = "chk" + AnItemName; chkAny.Text = AnItemName; iffp = new TIndividualFilterFindPanel( null, TCloneFilterFindControl.ShallowClone <CheckBox>(chkAny, TFilterPanelControls.FILTER_NAME_SUFFIX), null, "bit", "HasManualFilter"); FFilterAndFindObject.FilterPanelControls.FStandardFilterPanels.Add(iffp); }
private void CreateFilterFindPanelsManual() { Label lblDescription = new Label(); lblDescription.Name = "lblDescription"; lblDescription.Text = "Description"; TextBox txtDescription = new TextBox(); txtDescription.Name = "txtDescription"; TIndividualFilterFindPanel iffp = new TIndividualFilterFindPanel( TCloneFilterFindControl.ShallowClone <Label>(lblDescription, TFilterPanelControls.FILTER_NAME_SUFFIX), TCloneFilterFindControl.ShallowClone <TextBox>(txtDescription, TFilterPanelControls.FILTER_NAME_SUFFIX), "Parent_a_account_code_short_desc_c", "varchar", String.Empty); FFilterAndFindObject.FilterPanelControls.FStandardFilterPanels.Add(iffp); }