private void pivotGridControl1_CustomFilterPopupItems(object sender,
                                                              PivotCustomFilterPopupItemsEventArgs e)
        {
            // Fetches and sorts visible values of the current field.
            List <object> values = e.Field.GetVisibleValues();

            values.Sort();

            // Checks whether the filter drop-down customization logic differs
            // depending on the currently selected filter type.
            // If so, the filter type decides which filter items
            // will be hidden.
            bool?removingCriteria;

            if (((PivotGridControl)sender).OptionsFilterPopup.AllowFilterTypeChanging == false)
            {
                removingCriteria = true;
            }
            else
            {
                removingCriteria = e.Field.FilterValues.FilterType != PivotFilterType.Excluded;
            }

            // Hides filter items that are not currently visible
            // due to the filtering applied.
            for (int i = e.Items.Count - 1; i >= 0; i--)
            {
                if (e.Items[i].IsChecked == removingCriteria &&
                    values.BinarySearch(e.Items[i].Value) < 0)
                {
                    e.Items.RemoveAt(i);
                }
            }
        }
 void pivot_CustomFilterPopupItems(object sender, PivotCustomFilterPopupItemsEventArgs e)
 {
     if (Equals(e.Field, targetField))
     {
         this.ReplaceItemsByCustomRanges(e.Items);
     }
 }
Beispiel #3
0
 private void pivotGridControl1_CustomFilterPopupItems(object sender,
                                                       PivotCustomFilterPopupItemsEventArgs e)
 {
     if (rbCaptionLength.Checked)
     {
         ArrayList.Adapter((IList)e.Items).Sort(new FilterItemsComparer());
     }
 }
 protected void ASPxPivotGrid1_CustomFilterPopupItems(object sender,
                                                      PivotCustomFilterPopupItemsEventArgs e)
 {
     if (DropDownList1.Items[1].Selected)
     {
         ArrayList.Adapter((IList)e.Items).Sort(new FilterItemsComparer());
     }
 }
        private void pivotGridControl1_CustomFilterPopupItems(object sender, PivotCustomFilterPopupItemsEventArgs e)
        {
            List <object> values = e.Field.GetVisibleValues();

            values.Sort();
            for (int i = e.Items.Count - 1; i >= 0; i--)
            {
                if (e.Items[i].IsChecked == true && values.BinarySearch(e.Items[i].Value) < 0)
                {
                    e.Items.RemoveAt(i);
                }
            }
        }
 private void pivotGridControl1_CustomFilterPopupItems(object sender,
                                                       PivotCustomFilterPopupItemsEventArgs e)
 {
     if (object.ReferenceEquals(e.Field, fieldCountry))
     {
         for (int i = e.Items.Count - 1; i >= 0; i--)
         {
             if (object.Equals(e.Items[i].Value, "UK"))
             {
                 e.Items.RemoveAt(i);
                 break;
             }
         }
         e.Items.Insert(0, new PivotGridFilterItem(dummyItem,
                                                   "Dummy Item",
                                                   e.Field.FilterValues.Contains(dummyItem)));
     }
 }
Beispiel #7
0
 protected void ASPxPivotGrid1_CustomFilterPopupItems(object sender,
                                                      PivotCustomFilterPopupItemsEventArgs e)
 {
     if (object.ReferenceEquals(e.Field, fieldCategoryName))
     {
         for (int i = e.Items.Count - 1; i >= 0; i--)
         {
             if (object.Equals(e.Items[i].Value, "Beverages"))
             {
                 e.Items.RemoveAt(i);
                 break;
             }
         }
         e.Items.Insert(0, new PivotGridFilterItem(dummyItem,
                                                   "Dummy Item",
                                                   e.Field.FilterValues.Contains(dummyItem)));
     }
 }
        private void pivotGridControl1_CustomFilterPopupItems(object sender, PivotCustomFilterPopupItemsEventArgs e)
        {
            if (!rowField.Equals(e.Field))
            {
                return;
            }
            if (rowField.SortOrder == PivotSortOrder.Ascending)
            {
                return;
            }
            List <PivotGridFilterItem> items = new List <PivotGridFilterItem>(e.Items);

            items.Reverse();
            e.Items.Clear();
            foreach (PivotGridFilterItem item in items)
            {
                e.Items.Add(item);
            }
        }
 private void pivotGridControl1_CustomFilterPopupItems(object sender, PivotCustomFilterPopupItemsEventArgs e)
 {
     if (!cheKeepFilterItems.Checked)
     {
         return;
     }
     foreach (object value in fieldProductName.FilterValues.ValuesIncluded)
     {
         bool match = false;
         foreach (PivotGridFilterItem item in e.Items)
         {
             if (item.Value.ToString() == value.ToString())
             {
                 match = true;
             }
         }
         if (!match)
         {
             e.Items.Add(new PivotGridFilterItem(value, value.ToString(), true));
         }
     }
     ArrayList.Adapter((IList)e.Items).Sort(new FilterItemsComparer());
 }