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

grid drag and drop with text boxes

3 Answers 86 Views
Let's talk about telerik (the good and the bad)
This is a migrated thread and some comments may be shown as answers.
Preet
Top achievements
Rank 1
Preet asked on 09 Dec 2008, 08:24 PM
I would like to use .net drag and drop control.
But I do have a question :
I have list of 10 rows. Each row have 8 col. Few col have editable text boxes and one col is drop down.
Can I still drag and drop rows ? in other words, Can I move row 8 between row 1 and row 2, but it still keep same text boxes and values ?
pls advise.
thanks in advance

3 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 12 Dec 2008, 06:47 AM
Hello Preet,

Have you seen this demo?
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Programming/DragAndDrop/DefaultCS.aspx

Is this something similar to what you are trying to achieve?

Sincerely yours,
Ivo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Preet
Top achievements
Rank 1
answered on 15 Dec 2008, 03:33 PM
Thanks for your reply.

Yes, I saw this demo.

In my case, it is slightly different.
Rows will have editable text boxes and a drop down.
Demo have read only contents.

Will it work same way even though there are editable text boxes ?

I guess what is happening, when I have editable text box and press the mouse to edit, mouse down event gets trigger....
0
Accepted
Sebastian
Telerik team
answered on 16 Dec 2008, 03:38 PM
Hello Preet,

I am pasting my reply from the other thread you opened on this subject:

I suppose you are referring to the drag and drop feature of RadGrid for ASP.NET AJAX demonstrated here:

http://demos.telerik.com/aspnet-ajax/Grid/Examples/Programming/DragAndDrop/DefaultCS.aspx 

Am I assumption correct? You can drag and drop editable items within the same grid or another, however the row will be displayed in read-only mode in its new place by default. 

If you want to keep its edited state when reordering within the same grid instance:

  • Designate its new index in the grid items collection (the new index will be that of the e.DestDataItem passed in the OnRowDrop server handler increased by one)
  • Find the row on the new location by this index
  • Set its Edit property to true and refresh the grid invoking its Rebind() method. This step can take place in the PreRender handler of the grid.

Best regards,

Best regards,

Sebastian

the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Let's talk about telerik (the good and the bad)
Asked by
Preet
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Preet
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or