Пример #1
0
        /// <summary>
        /// Filters this table according to the cached filter parameters, if any exist.
        /// </summary>
        public void Filter()
        {
            if (_filterParams != null && _filterParams.Value != null)
            {
                _isFiltered = true;

                _filteredData = new FilteredItemCollection <TItem>(this, _filterParams);
            }
        }
Пример #2
0
        /// <summary>
        /// Removes the applied filter, if one exists.
        /// </summary>
        public void RemoveFilter()
        {
            _isFiltered = false;

            // ensure old filtered collections aren't updated when the table is updated.
            if (_filteredData != null)
            {
                _filteredData.Detach();
                _filteredData = null;
            }
        }
Пример #3
0
        ///<summary>
        /// Constructs a table with the specified number of cells in each row.
        ///</summary>
        public Table(int cellRowCount)
        {
            Platform.CheckArgumentRange((int)cellRowCount, 1, int.MaxValue, "cellRowCount");
            _cellRowCount = cellRowCount;

            _baseColumnWidth       = 10;
            _columns               = new TableColumnCollection <TItem>();
            _columns.ItemsChanged += delegate(object sender, ItemChangedEventArgs args)
            {
                switch (args.ChangeType)
                {
                case ItemChangeType.ItemAdded:
                    _columns[args.ItemIndex].Table = this;
                    break;

                case ItemChangeType.ItemRemoved:
                    _columns[args.ItemIndex].Table = null;
                    break;
                }
            };

            _data         = new ItemCollection <TItem>();
            _filteredData = null;
        }