Known Issues and Breaking Changes - RadGridView

Thread is closed for posting
1 posts, 0 answers
  1. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 16 Feb 2012 Link to this post

    Q1 2012 (version 2012.1.215)

    February 15, 2012

    BREAKING CHANGES
    • The ToggleButton inside the FilteringDropDown control has been replaced by a plain Button
    • Filtering API
    In order to enable filtering for our GridViewExpressionColumn, we had to rewrite our entire filtering infrastructure from scratch. We have made as few breaking changes as possible, but some of them were inevitable, for which we would like to apologize. Here is the list of the breaking changes that you should be aware of. Do not hesitate to write us if you are having problems with upgrading your project. We will do our best to assist you.
    • The IFilteringControl.Prepare method now expects the more general type GridViewColumn instead of a GridViewBoundColumnBase as its argument. If you were relying on GridViewBoundColumnBase-specific methods or properties you will have to add a check and a cast
    • The GridViewDistinctValuesLoadingEventArgs.Column property is now of the more general type GridViewColumn. If you were relying on GridViewBoundColumnBase-specific methods or properties you will have to add a check and a cast in your DistinctValuesLoading event handler
    • The GridViewDataControl.GetDistinctValues family of methods now accept a GridViewColumn instead of an IDataFieldDescriptor as their first parameter
    • The EditorCreatedEventArgs.Column is now of the more general type GridViewColumn. If you were relying on GridViewBoundColumnBase-specific methods or properties you will have to add a check and a cast in your DistinctValuesLoading event handler
    • The FilterOperatorsLoadingEventArgs.Column property is now of type GridViewColumn instead of IDataFieldDescriptor
    • The ColumnFilterDescriptor class has been made internal. Use the IColumnFilterDescriptor interface instead. It contains all relevant properties and methods
    • You can't directly instantiate a ColumnFilterDescriptor anymore since the class has been made internal. When you access the GridViewColumn.ColumnFilterDescriptor property, it will be automatically created on demand by the column and you will be given an IColumnFilterDescriptor to work with. For example: IColumnFilterDescriptor cfd = myColumnInstance.ColumnFilterDescriptor;
    • The IColumnFilterDescriptor.Column property is now of type GridViewColumn instead of IDataFieldDescriptor
    • The IColumnFilterDescriptor.DistinctFilter property is now of type IDistinctValuesFilterDescriptor instead of DistinctValuesFilterDescriptor
    • The IColumnFilterDescriptor.FieldFilter property is now of type IFieldFilterDescriptor instead of FieldFilterDescriptor
    • The DistinctValuesFilterDescriptor class has been made internal. It is not supposed to be used directly from your code. Use the IDistinctValuesFilterDescriptor interface instead
    • The FieldFilterDescriptor class has been made internal. It is not supposed to be used directly from your code. Use the IFieldFilterDescriptor interface instead
    • If you were using code from the GridViewCustomSerialization PersistenceFramework example, please update it according to the updated example
    • The GridViewDataControl.OnFiltering method is marked as obsolete now. It is not supposed to be used directly from your code and will be made internal in a future realease
    • The GridViewDataControl.OnFiltered method is marked as obsolete now. It is not supposed to be used directly from your code and will be made internal in a future release.
    • Filtering a Column
      • Old Code:
        GridViewColumn ageColumn = this.radGridView.Columns["Age"];
        ColumnFilterDescriptor ageColumnFilter = new ColumnFilterDescriptor(ageColumn);
        // ...
        ageColumnFilter.DistinctFilter.DistinctValues.Add(5);
        ageColumnFilter.FieldFilter.Filter1.Operator = FilterOperator.IsLessThan;
        ageColumnFilter.FieldFilter.Filter1.Value = 10;
        // ...
        this.radGridView.FilterDescriptors.Add(ageColumnFilter);
      • New Code:
        GridViewColumn ageColumn = this.radGridView.Columns["Age"];
        // Getting it from the property will create it and associate it with its column automatically.
        IColumnFilterDescriptor ageColumnFilter = ageColumn.ColumnFilterDescriptor;
        ageColumnFilter.SuspendNotifications();
        // ...
        ageColumnFilter.DistinctFilter.AddDistinctValue(5);
        ageColumnFilter.FieldFilter.Filter1.Operator = FilterOperator.IsLessThan;
        ageColumnFilter.FieldFilter.Filter1.Value = 10;
        // ...
        // There is no need to manually add the column filter to this.radGridView.FilterDescriptors
        // When the column filter is activated/deactivated it is automatically added/removed to this collection.
        ageColumnFilter.ResumeNotifications();
    • Clearing a Column Filter
      • Old Code:
        this.radGridView.FilterDescriptors.Remove(columnFilterDescriptor);
      • New Code:
        // Calling ClearFilter will automatically remove filter descriptor from the grid.
        myColumn.ClearFilters();
    • Clearing All RadGridView Filters
      • Old Code:
        this.radGridView.FilterDescriptors.Clear();
      • New Code:
        this.radGridView.FilterDescriptors.SuspendNotifications();
        foreach (var column in this.radGridView.Columns)
        {
        column.ClearFilters();
        }
        this.radGridView.FilterDescriptors.ResumeNotifications();

    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

Back to Top