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

Row on which node is dropped down

4 Answers 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sangeetha
Top achievements
Rank 1
Sangeetha asked on 25 Nov 2010, 10:35 AM

Hi

I have written drag & drop from treeview to gridview.
I am able to get the node in gridview but I am not able to get the row in which the drop is done.

Say 5 rows are there & i drop to the 3rd row, I want to get the row index in dragdrop event, but the current or selected row is null


Regards,
Sangeetha. G

4 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 25 Nov 2010, 11:01 AM
Hello Sangeetha,

You can always use the ElementTree.GetElementAtPoint(PointToClient) to get the cell on the drop point, like so
var currentCell = radGridView.ElementTree.GetElementAtPoint(radGridView.PointToClient(Cursor.Position)) as GridDataCellElement;
if (currentCell != null)
{
    var rowIndex = currentCell.RowIndex;
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Sangeetha
Top achievements
Rank 1
answered on 25 Nov 2010, 11:38 AM
Thanks for the reply.
I Tried the same, but got CurrentCell as null.
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 25 Nov 2010, 01:21 PM
Hello Sangeetha,

That should get you the cell on which the drop operation is performed, but can you please take a look at this code library project here?
This illustrates drag and drop between grids in bound mode, it should give you some idea on how to use the grid's drag drop service to position the elements.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP

0
Arul S V
Top achievements
Rank 1
answered on 08 Dec 2010, 11:01 AM
Telerik Team,

This works only there is a cell element present in the row. Row header will not have the cell element if we try to move the row via row header this won't work.(Mouse position will not be detectable)

If any solution plz reply at the earliest.

Thanks
Tags
GridView
Asked by
Sangeetha
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Sangeetha
Top achievements
Rank 1
Arul S V
Top achievements
Rank 1
Share this question
or