Ejemplo n.º 1
0
 protected virtual void CreateButtonsElement()
 {
     this.buttonsMenuItem                     = new FilterMenuButtonsItem();
     this.buttonsMenuItem.Margin              = new Padding(0, 5, 0, 0);
     this.buttonsMenuItem.ButtonOK.Click     += new EventHandler(this.ButtonOK_Click);
     this.buttonsMenuItem.ButtonCancel.Click += new EventHandler(this.ButtonCancel_Click);
     this.Items.Add((RadItem)this.buttonsMenuItem);
 }
Ejemplo n.º 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;
        }