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

Drag Drop between RadGrid hierarchy

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abdulaziz Bekr
Top achievements
Rank 1
Abdulaziz Bekr asked on 11 Sep 2012, 01:31 PM

 

I have one problem will explain it

I have two rad grid
The first grid hierarchy contain classes and class_id is primary key ,when expand one class
will show all the student in this class
The second gride has students the primary key student_id
I want drag and drop student from second grid to students in one class in first grid
Note: the students in first grid expanded from classes
also I want when I dragdrop the student
I want to get in which class_id

  The code below to retrieve student_id from second radgrid

 

Protected Sub RadGrid_Students_RowDrop(sender As Object, e As Telerik.Web.UI.GridDragDropEventArgs) Handles RadGrid_Students.RowDrop
        If e.DraggedItems.Count > 0 Then
            Dim a As String = e.DraggedItems(0).GetDataKeyValue("Client_id")
 
        End If
    End Sub


How retrieve in which class_id from destination radgrid

3 Answers, 1 is accepted

Sort by
0
Abdulaziz Bekr
Top achievements
Rank 1
answered on 12 Sep 2012, 02:31 AM
any body can help me
0
Abdulaziz Bekr
Top achievements
Rank 1
answered on 15 Sep 2012, 02:44 AM
Plz ,  help me
0
Tsvetina
Telerik team
answered on 20 Sep 2012, 06:53 AM
Hello Abdulaziz,

If I understand correctly, you need the primary key from the row that parents the table where you drop a row. If so, you can try the following in RowDrop:
GridDataItem parentItem = e.DestDataItem.OwnerTableView.ParentItem;
string key = parentItem.GetDataKeyValue("KeyName").ToString();


All the best,
Tsvetina
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Abdulaziz Bekr
Top achievements
Rank 1
Answers by
Abdulaziz Bekr
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or