How to drag and drop row in girdview ?

1 Answer 23 Views
GridView
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Aravind asked on 16 Aug 2024, 09:37 AM

Hi, 
       I want to drag and drop row in same grid like reorder the row. Is it possible to without create custom control ?
Actually we have file names in each row, user want to merge the file based on drag and drop, So user from which place to which place drop the row, we will merge that two file and refresh in grid. So for this we want drag and drop function.

I tried RadGridView.AllowRowReorder property to true , but still cant drag and drop the row. This is page load code for bind data in grid.

Private Sub LoadData()
        ' Create a DataTable and define its structure
        Dim dataTable As New DataTable()
        dataTable.Columns.Add("ID", GetType(Integer))
        dataTable.Columns.Add("Name", GetType(String))
        dataTable.Columns.Add("Age", GetType(Integer))

        ' Add some rows to the DataTable
        dataTable.Rows.Add(1, "John Doe", 30)
        dataTable.Rows.Add(2, "Jane Smith", 25)
        dataTable.Rows.Add(3, "Sam Brown", 35)

        ' Bind the DataTable to the RadGridView
        RadGridView1.DataSource = dataTable
    End Sub

Pls provide sample code in vb,

Thanks and Regards
Aravind

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 19 Aug 2024, 08:35 AM

Hello, Aravind,

When RadGridView is in bound mode, drag and drop functionality relies on the specificity of the DataSource collection of the source and target control. RadGridView handles the whole drag-and-drop operation by its RadGridViewDragDropService.

The following article will be quite useful to perform reordering rows via drag-drop in bound RadGridView: How to reorder rows in bound RadGridView - Telerik UI for WinForms

At the end of this article you will find a link to our SDK projects, containing project in VB.

I hope this information is useful. If you have other questions, please let me know. 

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or