RadDomainDataSource failing to filter with null value

8 posts, 0 answers
  1. Shikha
    Shikha avatar
    4 posts
    Member since:
    Jun 2014

    Posted 03 Jun 2014 Link to this post

    Hi,

    I am using Telerik 2013 Q3 and I have changed RadGridView to use RadDomainDataSource instead of DomainDataSource control . After making this change filtering on the columns is throwing exception 'Load operation failed for query. Object reference not set to an instance of object'. This exception is only thrown if the list of values for column has one or more null value. Filtering works fine on grid columns where data is not null. Is there a solution or a work around for this issue?

    Thanks,
    Shikha
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Jun 2014 Link to this post

    Hello Shikha,

    The error message says there is a problem with executing the "GetTransactionEventsForRoute" query due to a null reference exception.

    Are you able to successfully execute the same query with null values on the server? If so, may I also ask you to test with DomainDataSource?

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
  4. Shikha
    Shikha avatar
    4 posts
    Member since:
    Jun 2014

    Posted 04 Jun 2014 Link to this post

    Hello Didie,

    Thanks for your reply.

    "GetTransactionEventsForRoute" query runs successfully on the sever. I have also tested the same query against the DomainDataSource and filter works fine with null values in the Driver Column. See the attached screen shot.

    The grid displays list of records from Transaction Event table. Transaction Event table has 0 to 1 association with Driver table. Driver Name Column that is shown in the grid as Driver is a field on the Driver sub entity which in this case is null. Column filtering on the RadGridView with RadDomainDataSource fails to work and throws exception when the sub entity is null.

    Regards,
    Shikha







  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Jun 2014 Link to this post

    Hello Shikha,

    Thank you for performing this additional test. Would you also try subscribing for the LoadedData event and implement the suggested in the error message? Does it work fine except the exception?

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  6. Shikha
    Shikha avatar
    4 posts
    Member since:
    Jun 2014

    Posted 04 Jun 2014 in reply to Dimitrina Link to this post

    Hello Didie,

    I have added in the code to subscribe for the LoadedData and have called LoadedDataEventArgs.MarkErrorAsHandled(). By adding this it is just avoiding to display as the exception is being marked as handled. Please see the attached file HandledError.png

    Filter doesn't work at all. For example - If grid had 20 records before filtering on filtering it doesn't display any records. Please see the attached file BeforeFiltering.png and AfterFiltering.png.

    Regards,
    Shikha
     

     

     
  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Jun 2014 Link to this post

    Hello Shikha,

    I tested the same scenario locally and I was not able to reproduce any issue.
    I filled RadGridView with data from the Customers table in the Northwind database after I had set some of the ContactName's values to be NULL. Then I filtered on the null values and it worked fine. I also tried filtering on the values in the Region column.

    I have attached my test solution as a reference. You just need to connect to the Northwind database. Then, the Region column has some NULL values to filter on.

    May I ask you to modify my solution so that I can observe the problem?

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  8. Shikha
    Shikha avatar
    4 posts
    Member since:
    Jun 2014

    Posted 06 Jun 2014 Link to this post

    Hi Didie,
    Thanks for your help.

    I have modified the project such that it matches the issue that I am getting. But I can't attach .zip file to the post. Please let me know how can I do that. Getting this error.

    Attach Files 

    The selected file(s) cannot be attached because it may exceed the maximum attachment size (2 MB) or is from not allowed type (allowed: .jpg, .jpeg, .gif, .png).


  9. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Jun 2014 Link to this post

    Hello,

    You should open a support thread and attach the solution there.

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
DevCraft banner