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

Drag and Drop not Working with RadGrid's simple data-binding through the DataBind() method

2 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pinkesh
Top achievements
Rank 1
Pinkesh asked on 11 Nov 2013, 09:48 PM
Hi,

I used RadGrid's simple data-binding through the DataBind() method, so there is only two steps to make the datagrid, which is on page load event

RadGridID.DataSource = FRManager.GetAllFRData();
RadGridID.DataBind();

Now i can drag and drop the row and i got the event of protected void RadGridID
_RowDrop(object sender, GridDragDropEventArgs e)
{
}

Whatever example is given on the telerik on below link, i used it to bind but not get success.

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx?

please let me know what to write in this event to work out this, i took one field named OrderNumber in the table, this field is in hidden in my datagrid.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Nov 2013, 11:30 AM
Hi Pinkesh,

I have tried Drag and Drop functionality and it works with Simple DataBinding. A better option is to use the Advance DataBinding method. The key to the advanced data binding of a RadGrid control is handling the NeedDataSource event. RadGrid fires the NeedDataSource event each time it needs to be bound to a data source. If, at the time of the event, the DataSource property is not set to a valid data source object, the grid will not behave correctly. Please go through the documentation on Advanced Data-binding (Using NeedDataSource Event).
If this doesn't help, please provide your full code snippet.

Thanks,
Princy

0
Viktor Tachev
Telerik team
answered on 14 Nov 2013, 12:46 PM
Hi Pinkesh,

Thank you for contacting us.

Simple data binding is recommended when you have a simple scenario. For example if RadGrid is only used to show some data and there is no need for complex operations.

If you would like to implement more complex scenario you should use advanced data binding like illustrated in the demo. In the OnRowDrop event you should rebind the grid so that the changes are reflected.

I hope this information would be helpful to you.

Regards,
Viktor Tachev
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
Grid
Asked by
Pinkesh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Viktor Tachev
Telerik team
Share this question
or