grid drag and drop with text boxes

4 posts, 1 answers
  1. Preet
    Preet avatar
    8 posts
    Member since:
    Dec 2008

    Posted 09 Dec 2008 Link to this post

    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
  2. Ivo
    Admin
    Ivo avatar
    689 posts

    Posted 12 Dec 2008 Link to this post

    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.
  3. Preet
    Preet avatar
    8 posts
    Member since:
    Dec 2008

    Posted 15 Dec 2008 Link to this post

    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....
  4. Answer
    Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 16 Dec 2008 Link to this post

    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.
Back to Top