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

Edit/Add RadListView Items via RadWindow Dialog

1 Answer 173 Views
ListView
This is a migrated thread and some comments may be shown as answers.
James Daresta
Top achievements
Rank 1
James Daresta asked on 07 Oct 2013, 02:30 PM

I am working on a contact list similar to the demos for the RadListView. What I want to do is have the items bind server side. This could be via labels for each data field for an item or inputs like textboxes. Then on each item bound there would be an edit button. When the edit button is clicked then via client side script the values of the item would be passed to a dialog radwindow where they can edit it. When done they would click and ok button and then the dialog would pass the values back, they would be added to the ListView as a new item. Well the dialog was easy to do, but its the sending and receiving from the ListView that is proving difficult. The only option I see is custom attributes on the fields in the item and using jquery selectors.


So my question is whether there is a good sample code of editing the items of a list view client side and particularly in a rad window?



Secondly is there a way to have say either via loading it via the page or a service call back to the page the data list for a list view, bind it client side and then do similar what I described previously.



Thanks.

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 10 Oct 2013, 08:40 AM
Hello,

 Thank you for contacting us.

Generally the approach with window editing involves heavy server-side integration and processing of the data entered in the window.
You can easily open the RadWindow from the client-side but actually showing the data for the editing record and furthermore processing the require changes into an update or insert operation has to be done on the server. For example the window can trigger an ajax request and send its values to the server where you can perform the necessary operation and refresh the ListView. Similar example of this approach can be found in this online demo. It uses grid instead of ListView but generally the idea of passing the values to and from the server is the same.
The RadListView also supports pure client-side data binding as shown in this demo to a web service or any json object. This way all the operations and interaction with the ListView control have to performed on the client and no server-side events would be raised and no postback will be performed in this case. I suppose window editing can also be used in this case but it has to rely entirely on client-side interactions and operations, unfortunately we do not have such demo at the moment.

Feel free to contact us again if you have any other questions.

Kind Regards,
Marin
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.
Tags
ListView
Asked by
James Daresta
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or