ItemPropertyDefinitions dont work in 2011.2.0920 with numeric types

7 posts, 1 answers
  1. Doug
    Doug avatar
    15 posts
    Member since:
    Feb 2011

    Posted 04 Oct 2011 Link to this post

    Hi,

    I've just upgraded to the new Telerik version but my item property definitions now don't work for numeric types in the xaml or code behind (i tried there also).
    When I type into the filter it looks like its working (in that i can enter a double and its formatted as a double) but then it returns no results where it should!

    For example I have various definitions  such as the below in the xaml.


     <dataFilter:ItemPropertyDefinition PropertyName="PetSizeMb" PropertyType="{Binding Double, Source={StaticResource Types}}" DisplayName="Project file size (MB)"/>

    The default string results appear to be working fine are the custom editor results.

    If I switch the dlls back to the previous Telerik version it all works as it should.

    Thanks in advance
    Doug
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 04 Oct 2011 Link to this post

    Hello Doug,

    Could you please prepare a sample project that demonstrates this behavior and send us a support ticket with the project attached.

    Thanks in advance.

    Best wishes,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Doug
    Doug avatar
    15 posts
    Member since:
    Feb 2011

    Posted 12 Oct 2011 Link to this post

    Hi,

    I've been struggling to put this together in a sample project to send to you, but I can give some further information and perhaps ask another question. I can no longer seem to repeat the switching of dlls issue and I have just about convinced myself that there must have been some other factor at work which was leading me to believe all was well apart from the dll switch.

    After some experimentation I've narrowed down a difference in behaviour to be when filtering is done with the RadDomainDataSource (or QueryableDomainServiceCollectionView - i've tried everything i think).

    I tried the filtering on a simple collection and the numeric types work fine in this situation... However if I switch to use queryableDomainserviceCollectionView and try to filter on a field which isn't in the database but uses a field in the database to give a display value it doesnt seem to work. The same filter works on that field if I use the simple collection populated by loading from the domain context in the traditional manner. The RadDataSource also works fine for fields that come straight out of the database.

    So the question is, is this expected with use of the RadDataSource and QueryableDomainServiceCollectionView? Does this mean i can only make use of RadDataSource for columns which are part of the schema? This doesnt seem altogether satisfactory and perhaps i am missing something or there is a work around. Or do I have to go back to the old method?

    Thanks
    Doug

  5. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 12 Oct 2011 Link to this post

    Hi Doug,

    Here is how filtering works. When the user clicks around and defines some filtering criteria we take this and translate it into a LINQ Expression. Something like:

    sourceCollection.Where(customer => customer.FirstName == "John")

    When you have a simple in-memory collection, this lambda is compiled and dynamically invoked over this collection.

    When you have WCF RIA Services though, we take this expression, translate it accordingly and transfer it to the EntityQuery<T> so that the filtering will happen on the server and not on the client. Then we send a load request to the server with this filtered EntityQuery<T> and wait for the data to come back.

    So if the apply the .Where(customer => customer.FirstName == "John") to the EntityQuery<T> and send it to the server, if there is no database field named FirstName then the filtering will fail on the server.

    I guess that this is the reason for the behavior that you observe. The filtering is performed directly on the server and not on the client like in the "traditional manner".

    So if your data is not very much, your best shot would be to pull all of your data on the client in one single trip, load it in some kind of in-memory client-side collection and then work with this juts like you would do with any other "normal" collection.

    I hope this helps.

    Kind regards,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Doug
    Doug avatar
    15 posts
    Member since:
    Feb 2011

    Posted 12 Oct 2011 Link to this post

    Hi Ross,

    Thanks for your prompt response. That confirms succinctly pretty much what I arrived at.

    Are there any methods by which I can populate these additional fields data on the entity side of things without having to alter my schema, as I like (and really now need) to be able to utilse the RadDomainDataSource for paging when i click on a column header in the RadGrid. i.e Having switched to the RadDomainDataSource the pages are now sorted on the server before coming back to the client after i sort on a column which is great. 

    Apologies if this is really a RIASevices novice question but i guess i'm still a bit new to this.... it just seems i should be able to get around this filtering using display type fields without having to do away with my QueryableDomainServiceCollectionView i have in the model...

    Thanks
    Doug





  7. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 12 Oct 2011 Link to this post

    Hello Doug,

    I am afraid that if the things that you try to filter on the client are not present on the server then the filtering has no way of working. At least I don't know a way and I am not a WCF RIA guru either.

    I believe that your best shot would be to resolve this on the schema level.

    But before giving up, you can ask about this case on the RIA forums and StackOverflow.

    Best wishes,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Doug
    Doug avatar
    15 posts
    Member since:
    Feb 2011

    Posted 12 Oct 2011 Link to this post

    Ok then, thanks for your help

    Doug
Back to Top
DevCraft banner