Moving TreeGrid node

Hi
I can't speak English. So I use Google Translate.
Please understand if the explanation is not natural.

I tried using TreeGrid's drag and drop, but it didn't work smoothly.
So i want to move node on button click.

Any help to me would be appreciated.

1 Reply 1 reply marked as answer

GL Gowri Loganathan Syncfusion Team October 15, 2020 12:24 PM UTC

Hi JayHyeong, 
 
Thank you for contacting the Syncfusion Forums. No issue, we can understand your query. 
 
Query#1: I tried using TreeGrid's drag and drop, but it didn't work smoothly. 
In order to validate further, we request you to get back to us with the below information which would be more helpful for us to provide you the solution as early as possible. 
  1. Explain the issue that you have faced when using RowDragAndDrop in Tree Grid in detail.
  2. Share the video to demonstrate the issue faced.
  3. Share the complete Tree Grid code.
 
Query#2: Want to move node on Button click. 
 
We have achieved your requirement using ReorderRows method of SfTreeGrid inside the button click as shown in the below code snippet. 
 
Code snippet 
 
@using Syncfusion.Blazor.TreeGrid 
@using Syncfusion.Blazor.Buttons 
 
<SfButton OnClick="node">node</SfButton> 
 
<SfTreeGrid @ref="treegrid" DataSource="@TreeGridData" AllowRowDragAndDrop="true" TreeColumnIndex="1" IdMapping="TaskId" ParentIdMapping="ParentId"> 
    <TreeGridColumns> 
        ……………. . . 
    </TreeGridColumns> 
</SfTreeGrid> 
……………… . . . .. 
@code{ SfTreeGrid<WrapData> treegrid { get; set; } 
………… . .  
    private void node() 
    { 
        treegrid.ReorderRows(1, 6, "Above"); //pass (fromIndex, toIndex, Position) here 
    } 
} 
 
 
 
Before Button click 
 
 
After Button Click 
 
 
 
 
Also refer the API link below, 
 
Regards, 
Gowri V L 
 


Marked as answer
Loader.
Up arrow icon