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

Client-side Insert/Update/Delete without round trip

6 Answers 181 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JMKeynes
Top achievements
Rank 1
JMKeynes asked on 01 Jul 2009, 12:11 AM
I am writing an application where it is important to have the datagrid update immediately on Insert/Update/Delete operations rather than wait for the server to respond. In particular:

- I would like to implement Insert/Update/Delete in-line without making a round trip to the server until the user chooses to submit (at which time the server side collection is refreshed). 'Cancel' button restores state.
- I would like client-side insert/update to trigger a call to a web service passing a JSON object to validate the data (displaying the canonical loading symbol in a datagrid column until validated; error, warning, or OK icon then displayed depending on result; Netflix-like hover popup describing error/warning) without affecting the ability for the user to make subsequent changes to the datagrid.

I've been trying to think of an elegant solution using JQuery and client side caching, but defer to those with far greater expertise than I possess.  Is this possible? Better solution? If so, is there example code that I haven't found while searching?

RadGrid Version: 2007.3 1425
.NET Version: 3.5

Thanks in advance,
David

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Jul 2009, 06:24 AM
Hi,

I have found the following online demo which demonstrates how to perform Client-side Insert/Update/Delete operation. Go through it and see whether it helps.
Client-side Insert/Update/Delete

Shinu
0
JMKeynes
Top achievements
Rank 1
answered on 01 Jul 2009, 06:39 AM
Shinu,

Thank you for your reply. I ran across this post as well, but it does not accomplish what I am looking for.  This solution uses an external form and posts back to the server on each insert/update. I am trying to avoid as many trips to the server as possible so I am looking for a solution that both supports in-line editing/adding and only sends the updated/inserted objects to the server after all changes/additions are completed.

Thanks,
David
0
Sebastian
Telerik team
answered on 03 Jul 2009, 12:47 PM
Hello David,

Currently client-side update/insert/delete for RadGrid for ASP.NET AJAX is possible only with external edit form.

A possible solution to perform client-side edit by displaying hidden edited items on the client is presented in the second paragraph of this documentation topic. I hope is is applicable for your situation.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
JMKeynes
Top achievements
Rank 1
answered on 10 Jul 2009, 07:40 PM
Sebastian,

Thank you for your reply.  The link you provided was helpful, but not quite what I am looking for. The functionality I am seeking is purely client-side -- something similar to the Intersoft WebGrid (see, for example, the batch update demo at http://live.intersoftpt.com/Default.aspx?path=/WebGrid/New%20Features%20in%20v7/Client%20Binding&url=cs/WebGrid/ClientBinding_BatchUpdate.aspx).

Perhaps this is something not supported by the RadGrid now. However, if I were to modify the RadGrid, what do you believe would be required to implement this?

David
0
Manoj Bhatty
Top achievements
Rank 1
answered on 10 Jul 2009, 11:30 PM
I'm also looking for this functionality and its really a very common scenario. I tried to do it with regular asp.net GridView by putting  both the label and editable control in the item template and showing/hiding labels/editable controls via jquery on client side rowclick (also changing the styles accordingly to make it look like the grid is changing it's state etc). It works for the most part but is not quite as elegant as the Intersoft example. So I was wondering if a similar approach can be used with RadGrid (to a more polished and less error prone result)?

Some insights from RadGrid Forum Admins and users will be highly appreciated!

Manoj
0
Sebastian
Telerik team
answered on 15 Jul 2009, 02:28 PM
Hello guys,

Currently the solution you may consider is using the extractValuesFromItem client method of the grid to implement client-side editing similar to the example enclosed in this blog post on our site.

I will forward your feedback to our development department and we will do our best to improve the client editing capabilities of the grid for the upcoming versions of the product.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
JMKeynes
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
JMKeynes
Top achievements
Rank 1
Sebastian
Telerik team
Manoj Bhatty
Top achievements
Rank 1
Share this question
or