This is a migrated thread and some comments may be shown as answers.

Breaking changes Q3

1 Answer 56 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 17 Nov 2010, 10:15 AM
Hello,

I downladed de Q3 release this morning and surprise!!!! My solution do not compile beacuse some breaking changes in DataFilter control, that's now ItemsProperties property is obsolette and I have to use a new property that in addition is not a DependencyProperty (I don't know how I'll do DataBinding). I have no time to solve this issue and unfortunately I uninstalled de Q2 SP1 version, how can retrieve this old version? Please, is an emergency.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 17 Nov 2010, 10:53 AM
Hi DanĂ­,

First of all, we would like to apologize for having made this breaking changed.

But we really had to do this breaking change because more and more customers demanded that they want to able to define the item properties in XAML, which was impossible with the old ItemProperties property.

These breaking changes are described in the Release Notes about RadDataFilter.

The obsolete class ItemPropertyInfo derives from System.Object and the obsolete property ItemProperties is of type IEnumerable<ItemPropertyInfo>.

The new class ItemPropertyDefinition derives from DependencyObject and INotifyPropertyChanged. The new property ItemPropertyDefinitions is of type ObservableItemCollection<ItemPropertyDefinition>.

Having this in mind, I am totally confused how you are able to do data binding before and are unable now. It should be vice-versa, but I might be wrong. Could you please elaborate on this one.

Unlike ItemProperties, you can declare ItemPropertyDefinitons in XAML which was the main reason for this breaking change. Here is an online example on how to use ItemPropertyDefinitions in XAML. You can of course add them in code behind as well and it is much easier than working with the ItemPropertyInfo's

<telerik:RadDataFilter Name="radDataFilter"
                               Grid.Row="0"
                               Source="{Binding Items, ElementName=clubsGrid}"
                               AutoGenerateItemPropertyDefinitions="True"
                               Margin="1">
            <telerik:RadDataFilter.ItemPropertyDefinitions>
                <!--This will also be displayed along with the auto-generated properties.-->
                <datafilter:ItemPropertyDefinition PropertyName="Players.Count"
                                                   PropertyType="{Binding Int32, Source={StaticResource Types}}"
                                                   DisplayName="Squad Size">
                </datafilter:ItemPropertyDefinition>
            </telerik:RadDataFilter.ItemPropertyDefinitions>
        </telerik:RadDataFilter>

Notice the Players.Count definitions. This was impossible to do with the old ItemProperties.

In case you had a Type and called its extension method ToItemProperties(), you can now do the same since there is a new extension method called ToItemPropertyDefinitions() which returns an IEnumerable<ItemPropertyDefinition>, which you can directly add to RadDataFilter.ItemPropertyDefinitions collection. If you were doing this:

this.radDataFilter.ItemProperties = myType.ToItemProperties();

you should change it to this:

this.radDataFilter.ItemPropertyDefinitions.AddRange(myType.ToItemPropertyDefinitions);

Let me know if you need further assistance with this breaking change. I will be glad to help with the migration.

All the best,
Ross
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
Tags
DataFilter
Asked by
Daní
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or