// show only blue products void _btnBlue_Click(object sender, RoutedEventArgs e) { // get grid filter var f = C1FlexGridFilterService.GetFlexGridFilter(_flex); // customize color column filter var c = _flex.Columns["Color"]; var cf = f.GetColumnFilter(c); if (cf != null) { cf.ConditionFilter.Clear(); cf.ValueFilter.Values = new string[] { "Blue" }; } // apply changes f.Apply(); }
// show only expensive products void _btnExpensive_Click(object sender, RoutedEventArgs e) { // get filter var f = C1FlexGridFilterService.GetFlexGridFilter(_flex); // customize price column filter var c = _flex.Columns["Price"]; var cf = f.GetColumnFilter(c); if (cf != null) { cf.ValueFilter.Clear(); var c1 = cf.ConditionFilter.Condition1; c1.Operator = ConditionOperator.IsGreaterThanOrEqualTo; c1.Parameter = 900.5; } // apply changes f.Apply(); }
void _btnSave_Click(object sender, RoutedEventArgs e) { var f = C1FlexGridFilterService.GetFlexGridFilter(_flex); _filterDef = f.FilterDefinition; }
// toggle ICollectionView vs Row.Visible modes void _chkCollectionView_Click(object sender, RoutedEventArgs e) { var f = C1FlexGridFilterService.GetFlexGridFilter(_flex); f.UseCollectionView = _chkCollectionView.IsChecked.Value; }
// clear filters void _btnClear_Click(object sender, RoutedEventArgs e) { var f = C1FlexGridFilterService.GetFlexGridFilter(_flex); f.Clear(); f.Apply(); }
// load filter definition void _btnLoad_Click(object sender, RoutedEventArgs e) { var f = C1FlexGridFilterService.GetFlexGridFilter(_flex); f.FilterDefinition = _filterDef; f.Apply(); }