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

Drag/Drop Visual Display and selected rows

2 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John Roes
Top achievements
Rank 1
John Roes asked on 27 Apr 2011, 05:56 PM
I know it is possible to use a css to change the visual width of a row when it is dragged.

1. Is it possible to control the specific columns that are shown when a row is dragged?
2. Is it possible to disallow the ability to drag/drop a row based upon a condition or some other element?

Thanks much!
John

2 Answers, 1 is accepted

Sort by
0
John Roes
Top achievements
Rank 1
answered on 28 Apr 2011, 03:40 PM
Well, I found out how to take care of #2, disabling drag on a condition in a particular row.
Solution was to:

1: add a hidden, bound column to the radgrid containing the value to test for:
<tlk:GridBoundColumn UniqueName="EnableDrag" DataField="EnableDrag" HeaderText ="" Display="False" ColumnEditorID="GridTextBoxColumnEditor1" Resizable="False" />

 

2. then add the following JS: 

function RowDragStarted(sender, args)
{
    var row = sender.get_masterTableView().get_dataItems()[args.get_itemIndexHierarchical()];
    if (sender.get_masterTableView().getCellByColumnUniqueName(row, "DisplayLevel").innerHTML == "1")
    {
        args.set_cancel(true) //cancel the event
        //alert("Cannot drag this row");
    }
}

If anyone knows how to change the display of the row being dragged, it would be a great help!
Thanks

 

 

 

 

0
Iana Tsolova
Telerik team
answered on 28 Apr 2011, 04:21 PM
Hello John,

Try the solution provided in this code library and let me know if it works for you.

Regards,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
John Roes
Top achievements
Rank 1
Answers by
John Roes
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or