problem finding listview and setting datasource (client side)

2 posts, 0 answers
  1. Davy
    Davy avatar
    1 posts
    Member since:
    Sep 2013

    Posted 06 Sep 2013 Link to this post

    hi there,

    i have a problem finding the listview through javascript. it always returns null.
    also i get an error on setting datasource : function not known.
    i just included the 3 dll's in my bin folder. Serverside was working

    javascript:
    function pageLoad() {
        var listview = $find("rlvProducts");
        console.log(listview);
        listview.set_dataSource(products);
        listview.dataBind();
    }

    aspx:
    <telerik:RadListView ID="rlvProducts" CssClass="test" runat="server">
                    <ClientSettings>
                        <DataBinding ItemPlaceHolderID="iphProducts">
                            <LayoutTemplate>
                                <ul id="iphProducts">

                                </ul>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <li>#= id #</li>
                            </ItemTemplate>
                        </DataBinding>
                    </ClientSettings>
                </telerik:RadListView>

    also i followed this guide:
    http://blogs.telerik.com/aspnet-ajax/posts/12-02-06/client-side-databinding-with-radlistview-for-asp-net-ajax---part-1.aspx
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 11 Sep 2013 Link to this post

    Hello Davy,

    Can you please try to replace '$find("rlvProducts")' with '$find("<%= rlvProducts.ClientID %>")' and see if it solves the issue.

    Additionally, attached you can find a simple project with your scenario that works as expected on my side.

    For more information about the client ListView object you could take a look at our help article: "Getting RadListView Client Object"

    Hope that helps.

     

    Regards,
    Konstantin Dikov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top