Beispiel #1
0
        private void OnSortOrderChanged(object sender, EventArgs e)
        {
            GridFilteringControl control = (GridFilteringControl)sender;

            this.listView.SortDescriptors.Clear();
            if (control.SelectedSortOrder.HasValue)
            {
                this.listView.SortDescriptors.Add(
                    new PropertySortDescriptor
                {
                    PropertyName = control.ColumnName,
                    SortOrder    = control.SelectedSortOrder.Value
                });
            }
        }
Beispiel #2
0
        private void OnFilterChanged(object sender, EventArgs e)
        {
            GridFilteringControl control = (GridFilteringControl)sender;

            this.listView.FilterDescriptors.Clear();

            if (!string.IsNullOrEmpty(control.FilterValue))
            {
                this.listView.FilterDescriptors.Add(new DelegateFilterDescriptor
                {
                    Filter = (obj) =>
                    {
                        if (control.SelectedFilterMode == FilterMode.Contains)
                        {
                            return(this.ContainsFilter(control.ColumnName, control.FilterValue, obj));
                        }

                        return(this.IsEqualToFilter(control.ColumnName, control.FilterValue, obj));
                    }
                });
            }
        }