public void SetFilter(DataSchema dataSchema, PropertyDescriptor propertyDescriptor, RowFilter rowFilter) { RowFilter = rowFilter; SetPropertyDescriptor(dataSchema, propertyDescriptor); var columnFilters = rowFilter.GetColumnFilters(propertyDescriptor).ToArray(); if (columnFilters.Length >= 1) { SetFilterOperation(comboOperation1, tbxOperand1, columnFilters[0]); tbxOperand1.Text = columnFilters[0].Operand; } if (columnFilters.Length >= 2) { SetFilterOperation(comboOperation2, tbxOperand2, columnFilters[1]); } }
public RowFilter SetText(string text, bool caseSensitive) { RowFilter rowFilter = new RowFilter(this) { CaseSensitive = caseSensitive, }; if (string.IsNullOrEmpty(text)) { rowFilter._normalizedText = rowFilter.Text = null; } else { rowFilter.Text = text; rowFilter._normalizedText = caseSensitive ? text : text.ToLower(); } return rowFilter; }
public void OkDialog() { RowFilter = GetCurrentFilter(); DialogResult = DialogResult.OK; }
private void SetFilterOperation(ComboBox comboOperation, TextBox textBoxOperand, RowFilter.ColumnFilter columnFilter) { for (int i = 0; i < comboOperation.Items.Count; i++) { FilterItem filterItem = comboOperation.Items[i] as FilterItem; if (null != filterItem && Equals(columnFilter.FilterOperation, filterItem.FilterOperation)) { comboOperation.SelectedIndex = i; break; } } textBoxOperand.Text = columnFilter.Operand; }
private void btnClearFilter_Click(object sender, EventArgs e) { RowFilter = RowFilter.SetColumnFilters( RowFilter.ColumnFilters.Where( columnFilter => PropertyDescriptor.DisplayName != columnFilter.ColumnCaption)); DialogResult = DialogResult.OK; }
private void btnClearAllFilters_Click(object sender, EventArgs e) { RowFilter = RowFilter.Empty; DialogResult = DialogResult.OK; }
public QueryParameters SetRowFilter(RowFilter value) { return new QueryParameters(this) {RowFilter = value}; }
public QueryParameters(ViewInfo viewInfo, RowFilter rowFilter, ListSortDescriptionCollection sortDescriptions) { ViewInfo = viewInfo; RowFilter = rowFilter; SortDescriptions = sortDescriptions; }
public void ApplySort(ListSortDescriptionCollection sorts) { RowFilter = RowFilter.ChangeListSortDescriptionCollection(sorts); // Fire an event so that the NavBar updates to show that the DataGridView is sorting OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); }
public void OkDialog() { RowFilter = GetCurrentFilter(); try { RowFilter.GetPredicate(PropertyDescriptor); } catch (Exception e) { ShowErrorMessage(e); return; } DialogResult = DialogResult.OK; }
protected RowFilter(RowFilter rowFilter) { Text = rowFilter.Text; _normalizedText = rowFilter._normalizedText; ColumnFilters = rowFilter.ColumnFilters; }
public bool Equals(RowFilter other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Text, Text) && other.CaseSensitive.Equals(CaseSensitive) && Equals(other.ColumnFilters, ColumnFilters); }