Example #1
0
 public override bool OnMouseWheel(Control target, int delta)
 {
     if (target is RadSizableDropDownMenu || target is RadTreeView || target is RadGridView)
     {
         FilterMenuTreeItem filterMenuTreeItem = this.GetFilterMenuTreeItem();
         if (filterMenuTreeItem != null)
         {
             delta = delta >= 0 ? 3 : -3;
             filterMenuTreeItem.TreeElement.TreeView.TreeViewElement.ScrollTo(delta);
         }
     }
     return(true);
 }
Example #2
0
        protected virtual void CreateListFilterMenuItems()
        {
            this.textBoxMenuItem = new FilterMenuTextBoxItem();
            this.textBoxMenuItem.TextBox.TextChanged += new EventHandler(this.textBoxSearch_TextChanged);
            this.Items.Add((RadItem)this.textBoxMenuItem);
            System.Type        filteringDataType  = this.ColumnFilteringDataType;
            FilterMenuTreeItem filterMenuTreeItem = new FilterMenuTreeItem();

            filterMenuTreeItem.TreeElement.GroupedDateValues = this.groupedDateValues && ((object)filteringDataType == (object)typeof(DateTime) || (object)filteringDataType == (object)typeof(DateTime?));
            this.listFilterElement = (IRadListFilterElement)filterMenuTreeItem.TreeElement;
            this.menuTreeElement   = filterMenuTreeItem.TreeElement;
            this.listFilterElement.SelectionChanged += new EventHandler(this.ListFilterElement_SelectionChanged);
            this.Items.Add((RadItem)filterMenuTreeItem);
            this.buttonsMenuItem = new FilterMenuButtonsItem();
            this.buttonsMenuItem.ButtonOK.Click     += new EventHandler(this.ButtonOK_Click);
            this.buttonsMenuItem.ButtonCancel.Click += new EventHandler(this.ButtonCancel_Click);
            this.Items.Add((RadItem)this.buttonsMenuItem);
            RadListFilterDistinctValuesTable distinctValuesTable = this.GetDistinctValuesTable();

            this.listFilterElement.DistinctListValues = distinctValuesTable;
            RadListFilterDistinctValuesTable selectedValuesList = new RadListFilterDistinctValuesTable();

            selectedValuesList.FormatString = this.DataColumn.FormatString;
            RadListFilterDistinctValuesTable excludedValuesList = new RadListFilterDistinctValuesTable();

            excludedValuesList.FormatString     = this.DataColumn.FormatString;
            this.listFilterElement.SelectedMode = this.GetGridFilteredValues(this.DataColumn.OwnerTemplate.FilterDescriptors, ref selectedValuesList, ref excludedValuesList);
            if (excludedValuesList.Count > 0)
            {
                selectedValuesList.Clear();
                foreach (DictionaryEntry dictionaryEntry in distinctValuesTable)
                {
                    if (!excludedValuesList.Contains(dictionaryEntry.Key))
                    {
                        if (!(dictionaryEntry.Value is ArrayList))
                        {
                            selectedValuesList.Add(dictionaryEntry.Key);
                        }
                        else
                        {
                            selectedValuesList.Add(dictionaryEntry.Key.ToString(), (ArrayList)dictionaryEntry.Value);
                        }
                    }
                }
            }
            this.listFilterElement.SelectedValues = selectedValuesList;
            this.listFilterElement.EnableBlanks   = this.DataColumn.ContainsBlanks;
        }