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

How to declaritively ajaxify row drag and drop

1 Answer 36 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Steven asked on 13 Oct 2012, 09:12 PM

I have 2 grids. Grid 1 has several controls (dropdowns, datepicker).

Initially, using the RadAjaxManager, I ajaxified grid 1, so that it would update Grid 2 if these controls were updated (they autopost). I'm trying to improve performance, and realized that only some of the controls in Grid 1, need to update Grid2. So following the methodology found here:

I'm ajaxifying each control separately. So some controls update Grid1 only, and some update Grid1 and Grid2. This works great.

The problem that I am having, is that I have a drag and drop functionality from Grid 1, to Grid 2.

Previously, when I ajaxified the whole grid, the drag and drop was ajaxified, and both Grid 1, and Grid 2 were both updated. Now that I am doing each control individually, I've lost this functionality.

How do I declaritively setup the drag and drop to ajaxifying both Grid 1 and Grid 2 again? I don't know what "control" to use to add the AjaxSettings.

Thanks for your help.


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 18 Oct 2012, 07:16 AM
Hello Rich,

I am posting my initial reply from the support thread you had opened if anyone else gets to the same scenario:

Since in this scenario RadGrid initiates the postback, the only easy way to do this only using an AjaxSetting is to revert to having the setting where Grid1 always updates Grid2. If you do not want this, you can try the following work around, which would require modifying your drag drop logic to some extent:

1) Add a setting, where RadAjaxManager updates Grid1 and Grid2. This means that the manager will update the controls, only when an ajaxRequest() client method call has been made on the page (not for all requests, as it may seem).
2) Wire the client-side OnRowDropping event of RadGrid to prevent it from making the post.
3) Gather the needed information about the row drop from the event arguments of the event: 
Use them to build an argument which you can use on the server to access the dragged and destination items in the grids.
4) Use the client ajaxRequest(arg) method of RadAjaxManager to trigger an AJAX request: 
 Client-Side API 

This way the initiator of the request will be RadAjaxManager, meaning that only the controls listed as UpdatedControls in the above mentioned setting will be updated.

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.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question