Missing Property causes Filtering and Sorting to no longer work

8 posts, 0 answers
  1. Peter
    Peter avatar
    5 posts
    Member since:
    Jun 2014

    Posted 30 Dec 2015 Link to this post

    I'm using RadGridView to show certain properties of a list of elements.
    This works as expected as long as all elements in the list have all properties the columns bind to.

    But once only one element does not have a property a column binds to the whole columns fails to correctly support sorting and filtering.

    When sorting no element is shown at all and the filter dialog does not show any values. See attached screenshots.

    This still happens even though a FallbackValue of the right type is provided in the Binding.

     

    Is there a way to make this work? Sadly I can not avoid having some elements that do not implement all properties, so a failing binding most be handled in a better way. 

     

    My Xaml:

    <Window x:Class="WpfTestApplication.MainWindow"
            xmlns:telerikG="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
            xmlns:telerikD="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
            Title="MainWindow" Height="200" Width="300">
        <Grid>
            <telerikG:RadGridView ItemsSource="{Binding Elements}" AutoGenerateColumns="False">
                    <telerikG:RadGridView.Columns>
                    <telerikG:GridViewDataColumn Header="cost" DataMemberBinding="{Binding cost, FallbackValue=0.0}"/>
                    </telerikG:RadGridView.Columns>
                </telerikG:RadGridView>
        </Grid>
    </Window>
  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    431 posts

    Posted 04 Jan 2016 Link to this post

    Hello Peter,

    I have tried reproducing the issue you have described but was not able to. I have recorded the behavior and you can review it at http://screencast.com/t/l26cmAGhI. Can you please provide some more information regarding the setup at your end and more specifically the data source for the grid? 

    I have also created a sample project for you. Would it be possible to modify it so that it represents the undesired behavior and send it over so I can have a more detailed look and hopefully find the root of the issue? 

    I am looking forward to your reply, Peter.

    Regards,
    Stefan Nenchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Peter
    Peter avatar
    5 posts
    Member since:
    Jun 2014

    Posted 04 Jan 2016 Link to this post

    Hello Stefan,

    I was able to modify your example.
    You just set a property to null. But my Problem is triggered when a object is off a different type has does not have a certain property at all.

    The problem is probably also related to the fact that our models use the ICustomTypeDescriptor interface to expose properties at runtime.

     

    Regards,
    Peter Grüner

  4. Frazz Jarvis
    Frazz Jarvis avatar
    6 posts
    Member since:
    Mar 2005

    Posted 15 Jun Link to this post

    Hi Peter/Stefan,

    Old post I know but I'm currently having a very similar problem (null values in runtime-generated columns causing sort and filter to fail as described in Peters's original post/screenshots).  I'm using ExpandoObject to create the column data. Grid sorts/filters perfectly if a column has no null values BTW.

    Currently using build 2017.2.614.

    Any help would be much appreciated.

    Best regards,

    Frazz

  5. Stefan X1
    Admin
    Stefan X1 avatar
    710 posts

    Posted 20 Jun Link to this post

    Hi Peter,

    The issue reported in this thread rooted in the fact, that there were missing properties in the bound item that the data engine of RadGridView is searching for. The malfunction in such case would be the expected one. However, you stated setting null values instead, which is supported for an object implementing IDynamicMetaObjectProvider. With this in mind, can you please clarify whether you are simply setting a null value to a given property of the ExpandoObject, or you are defining columns that are bound to a property that is not present in the bound item?

    Best Regards,
    Stefan X1
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Frazz Jarvis
    Frazz Jarvis avatar
    6 posts
    Member since:
    Mar 2005

    Posted 20 Jun Link to this post

    Hi Stefan,

    Thanks for your reply.  Makes sense re missing properties (I had jagged data).  Removing the jaggedness solves my problem.  I still have issues with filtering due to the use of dynamic properties and I presume this is still an issue (highlighted in a previous post of yours regarding dynamic data - http://www.telerik.com/forums/binding-radgridview-with-dynamic-column)?

    Best regards,

    Frazz

  7. Stefan X1
    Admin
    Stefan X1 avatar
    710 posts

    Posted 23 Jun Link to this post

    Hi Frazz,

    Firstly, please, excuse me for mistaking you with the previous user in this thread.

    As to the issue you are experiencing, I am not completely sure what it is. Note, that if it is related to the filter operators that are generated for a dynamic type, as discussed in the forum thread to which you referred, this would be the expected behavior. Can you please clarify this?

    Regards,
    Stefan X1
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  8. Frazz Jarvis
    Frazz Jarvis avatar
    6 posts
    Member since:
    Mar 2005

    Posted 23 Jun Link to this post

    Hi Stefan,

    No worries re name :).  Yep, I guess I'm saying that I do indeed have the issue with the default filtering options in regard to dynamic types so will probably implement a custom filter to get around that.  Thanks for the help regardless.

    Frazz

Back to Top