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

[Solved] Can drag and drop reorder be limited to only some grid rows?

3 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 08 Apr 2013, 10:55 PM
A client wants a grid where only some of the rows can be dragged around and re-ordered.  Is it possible to present the drag bar only on some rows in the table but not others?  If so, can you point me towards the area of the documentation for this?  Thank you.

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 09 Apr 2013, 04:48 AM
Hello,

function RowSelecting(sender, eventArgs) {
                if (eventArgs._dataKeyValues.ID == 1) {
                    eventArgs._cancel = true;
//OR
eventArgs.set_cancel(true); //cancel event

                }
            }

<ClientSettings>
               <Selecting AllowRowSelect="true" />
               <ClientEvents OnRowSelecting="RowSelecting" />
           </ClientSettings>

<MasterTableView DataKeyNames="ID"
             ClientDataKeyNames="ID">

If any ID DataField have value is 1 then it can not be draggable.

Thanks,
Jayesh Goyani
0
Lisa
Top achievements
Rank 1
answered on 09 Apr 2013, 02:17 PM
Thanks Jayesh.  One question though, does this prevent the drag icon from appearing on the row or just prevent the user from being able to drag it?  In other words, does the user have a visual clue that a particular row is NOT draggable?
0
Jayesh Goyani
Top achievements
Rank 2
answered on 15 Apr 2013, 02:11 PM
Hello,

Are you used "GridDragDropColumn"  for that.?

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Lisa
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Lisa
Top achievements
Rank 1
Share this question
or