Both Virtualization and Cascading in one DropDownList?

5 posts, 1 answers
  1. Kevin
    Kevin avatar
    12 posts
    Member since:
    Jan 2015

    Posted 07 Oct 2015 Link to this post

    We have a DropDownList that has several thousand records, so we set it up using Virtual following the example of the Virtualization demo.  We have a new requirement that those records need to be filtered by the selection of a different DropDownList, so this virtual DropDownList will need to cascade from the other DropDownList.  Even filtered, there will still be a thousand records in the DropDownList, so it still needs to be virtual.

    Is it possible to use virtualization with a DropDownList that cascades?

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 09 Oct 2015 Link to this post

    Hello Kevin,

    Yes, the widget can be used both with cascading and virtualization functionality. In their code, those features will filter (cascade) and page (virtualize) the data. If those actions are implemented correct on server side, then there shouldn't be any issues. In other words, you need to ensure that filtering and paging are implemented correctly. For instance, our online virtualization demo shows how to filter and page the date together.

    I would suggest you review the Virtualization help topic for more details.

    Regards,
    Georgi Krustev
    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. UI for ASP.NET MVC is VS 2017 Ready
  4. Kevin
    Kevin avatar
    12 posts
    Member since:
    Jan 2015

    Posted 09 Oct 2015 in reply to Georgi Krustev Link to this post

    Hi Georgi, I think we might be referring to two different things.  I see that this virtualization example appears to use .Filter(FilterType.Contains) -- although I don't see that in the example code -- but I need to use the Cascading DropDownList feature (like this example) along with virtualization, and that's where I'm having trouble.

    The cascading dropdownlist uses this type of datasource:

    .DataSource(source => {
        source.Read(read =>
        {
            read.Action("GetCascadeOrders", "ComboBox")
                .Data("filterOrders");
        })
        .ServerFiltering(true);
    })
     

    The virtualization dropdownlist uses a custom datasource with:

    .Transport(transport =>
    {
        transport.Read("Virtualization_Read", "DropDownList");
    })
     

    transport.Read does not appear to have the option to add a .Data() JavaScript to it to enable the filtering on the Id of the DropDownList being cascaded from.

    Would you be able to make an example of modifying the Cascading DropDownList demo to make the Orders dropdownlist virtualized, so that it still cascades from the Products dropdownlist, but is also virtualized?

  5. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 13 Oct 2015 Link to this post

    Hello Kevin,

    The cascading functionality in its essence is "filtration". You can find more details in this article:
    The virtualization on the other hand is just data paging (in the server side perspective). More details can be found here:
    That being said, once the server supports filtration and paging, the child widget that is virtualized and cascades from parent should work without a problem. The custom data source even simplifies the things, because both cascade filter and page details are applied all together by ToDataSourceResult method.

    Please check the attached test project, which shows how cascading can be combined with virtualization.

    Regards,
    Georgi Krustev
    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. Kevin
    Kevin avatar
    12 posts
    Member since:
    Jan 2015

    Posted 13 Oct 2015 in reply to Georgi Krustev Link to this post

    Hi Georgi, thank you for walking me through that and making that clear.  I see now my problem was I was trying to do the filtering on the Id of cascaded from dropdown myself, in both the ValueMapper function and the DataSource Read, and I couldn't get the DataSource to use the Id.  I appreciate you making it clear that the DataSourceRequest handles the filtering on the cascaded from Id.  Thanks!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready