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

JSON and RadListView

3 Answers 77 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Raventhorn
Top achievements
Rank 2
Raventhorn asked on 03 Jul 2012, 04:28 AM
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.

3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 05 Jul 2012, 10:34 AM
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.
0
mirang
Top achievements
Rank 1
answered on 14 Aug 2012, 02:19 PM
Any client side binding with server controls possible.
0
Tsvetoslav
Telerik team
answered on 15 Aug 2012, 06:13 AM
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.
Tags
ListView
Asked by
Raventhorn
Top achievements
Rank 2
Answers by
Tsvetoslav
Telerik team
mirang
Top achievements
Rank 1
Share this question
or