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

Virtual Scrolling using ObjectDataSource

1 Answer 50 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Digifox
Top achievements
Rank 1
Digifox asked on 31 May 2014, 08:21 AM
Is it possible to get Virtual Scrolling going using ObjectDataSource? I haven't been able to find any good examples except for those on the demo-site (http://demos.telerik.com/aspnet-ajax/dropdownlist/examples/functionality/virtualscrolling/defaultcs.aspx). Unfortunately, the DropDownList doesn't seem to provide the ObjectDataSource with values for "StartIndex" and "ItemsCount" as per the WebService-datasource example.

Below is a simple example, describing the desired scenario. The Facade is in place and works well with other types of solutions, e.g. paging a Grid using an ObjectDataSource.


<asp:ObjectDataSource ID="ODSNotifications" runat="server"
        TypeName="NotificationsFacade"
        SelectMethod="Get"
        OnSelecting="ODSNotifications_Selecting"
        EnablePaging="true"
        SelectCountMethod="GetCount"       
        StartRowIndexParameterName="StartIndex"
        MaximumRowsParameterName="ItemsCount">
        <SelectParameters>
            <asp:Parameter Name="userId" Type="Int32" />
            <asp:Parameter Name="fromDate" Type="DateTime" />
        </SelectParameters>
    </asp:ObjectDataSource>
 
    <telerik:RadDropDownList ID="RDDLNotifications" runat="server"
        DataSourceID="ODSNotifications"
        CssClass="RDDLNotifications"
        DataValueField="Title"
        DataTextField="Id"
        OnItemDataBound="RDDLNotifications_ItemDataBound"
        DropDownWidth="200px"
        DropDownHeight="100px"
        EnableVirtualScrolling="true">
        <ItemTemplate>
            <asp:Panel ID="PNotification" runat="server" CssClass="w_n_outer" onclick="StopPropagation(event);">
                <div class="w_n_inner">
                    <asp:Label ID="LType" runat="server" Font-Size="0.8em" />
                    <br />
                    <asp:Label ID="LTitle" runat="server" Font-Bold="true" />
                    <br />
                    <asp:Label ID="LBody" runat="server" />
                </div>
            </asp:Panel>           
        </ItemTemplate>
    </telerik:RadDropDownList>

Any help would be greatly appreciated!


1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 04 Jun 2014, 02:45 PM
Hello Andreas,

I am afraid that currently such implementation is not possible, since as you had well observe the ItemsCount and StartIndex are the needed parameters, for the implementation of the asynchronous loading of the Items (when the Virtual Scrolling is enabled. )

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DropDownList
Asked by
Digifox
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or