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

Drop From GridView

3 Answers 40 Views
ListView
This is a migrated thread and some comments may be shown as answers.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
pierre-jean asked on 08 Oct 2020, 12:21 PM

Hello

I need a drag Drop from gridview to listview.

I have followed the code from the documentation and everything works finew up to the drop on the ListView where I fail to identify the row of the listview into which the drops occurs.

I have the following code (copied from Telerik's documentaiton)

                    targetCell.Text = srcRow.RowInfo.Cells("Name").Value
                    Dim targetElement As DetailListViewElement = TryCast(e.HitTarget, DetailListViewElement)
                    Dim targetVisualItem As BaseListViewVisualItem = targetCell.RowElement
                    Dim insertIndex As Integer = targetCell.Row.ListView.Items.IndexOf(targetVisualItem.Data)

and I get an error on .row and .rowelement which are "not members ..."

Am I missing a reference or is it a change of the components ?

I need to get the row of the listview when I perform the drom on the cell

Thanks in advance for any advice

Best Regards

Pierre-Jean

3 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 08 Oct 2020, 04:18 PM

Hello, Pierre-Jean,

Following the provided information and code snippet it seems that you follow the example provided here where drag drop operation from RadGridView to RadListView is shown. Could you please confirm that you refer to this example in the documentation article?

If you follow this example, the targetCell is DetailListViewDataCellElement and the Row and RowElement properties are accessible. I created a sample project with the code example described in the article for your reference. You can refer to it and see how it works.

If you are still experiencing any further difficulties, it would be greatly appreciated if you can modify the sample project demonstrating the problem that you have and get it back to me.

I hope this helps. If you need any further assistance do not hesitate to contact me. 

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 08 Oct 2020, 06:14 PM

Hello Nadya

Thanks a lot for your message

I had an error in the type of the "targetCell", I had DetailListViewCellElement instead of DetailListViewDataCellElement

thanks again

Best Regards

0
Nadya | Tech Support Engineer
Telerik team
answered on 09 Oct 2020, 02:50 PM

Hello, Pierre-Jean,

Note, the DetailListViewCellElement represents the visual cell element while the DetailListViewDataCellElement represents the data cell. In the PrevieDradDrop event, you should use the DetailListViewDataCellElement.

Should you have any other questions please let me know.

Regards,
Nadya
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
ListView
Asked by
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or