JSON and RadListView

4 posts, 0 answers
  1. Armysniper
    Armysniper avatar
    61 posts
    Member since:
    Mar 2005

    Posted 02 Jul 2012 Link to this post

    I have a question. Is it possible to use JSON to query a web service and return a RadListViewItem (or preferably an array of them) to then append to the current listview on the page without a postback or lengthy ajax call? I have watched a few of the demos on how to use JSON and a web service but it didn't entirely help (new to JSON). Anyways, I am essentially making a commenting system and I want people to be able to load comments on demand and post new comments without experiencing a somewhat lengthy AJAX call using the panels or postingback completely. Right now when someone ads a new comment it actives the radajax components of the panel to make the call. It isn't terrible but I want something a little faster and seemless for the user. Let me know if something like this would work and if so, where I might start (specifically how to handle the return):

    User wants to view more comments:

    On page load (load top 30 results)
    click "more" button and use JSON to get an array of RadListViewItems and append them to the current list view at the bottom (everything is ordered by date).

    User wants to post:
    Use JSON to write post to database (I can do this)
    get the new record and return it as a RadListViewItem.

    Thanks for all of your help guys.
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 05 Jul 2012 Link to this post

    Hello Shannon,

    Thank you for contacting us.

    I believe the answer to both of your questions is provided by RadListView's client-side component's appendData(array) method. Please, go through the following online example that is identical in principle to your own scenario:
    http://demos.telerik.com/aspnet-ajax/listview/examples/client/appendingdata/defaultcs.aspx

    Do let us know if you need further assistance.

    All the best,
    Tsvetoslav
    the Telerik team
    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 their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mirang
    mirang avatar
    115 posts
    Member since:
    Aug 2010

    Posted 14 Aug 2012 Link to this post

    Any client side binding with server controls possible.
  5. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 15 Aug 2012 Link to this post

    Hi Mirang,

    It is possible with some of the telerik controls such as RadGrid, RadListView, RadTreeView, RadCombBox:
    http://demos.telerik.com/aspnet-ajax/grid/examples/client/livedata/defaultcs.aspx
    http://demos.telerik.com/aspnet-ajax/listview/examples/client/webservicedatabinding/defaultcs.aspx
    http://demos.telerik.com/aspnet-ajax/treeview/examples/loadondemand/wcf/defaultcs.aspx
    http://demos.telerik.com/aspnet-ajax/combobox/examples/loadondemand/wcf/defaultcs.aspx

    Regards,
    Tsvetoslav
    the Telerik team
    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 their blog feed now.
Back to Top