Customizing the tooltip that displays on drag

Hi syncfusion,


I am using the treegrid component and when dragging a node a tooltip appears that appears to be the contents of the row from the tree grid, but greyed out and rearranged in an unattractive way.


We would like to customize this tooltip and make it . Please tell us how.

Thankyou,

Arthur Campbell


3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team September 6, 2022 03:24 PM UTC

Hi Arthur,


We will check for the feasibility of the reported query and provide you further details by on or before 8th September 2022. Until then we appreciate your patience.


Regards,

Farveen sulthana T



AC Arthur Campbell September 8, 2022 11:30 AM UTC

Hi there,


I have further questions regarding what is possible here.

Firstly we have reverted to using a treeview component here (the treegrid component did not actually fit our purposes given some limitations in its drag and drop functionality compared to the treeview).

I can tell how to apply some styles to the floating dragged item, however the more interesting thing I would like to do is give the user some visual indication as to whether where they are hovering is a valid drop target.

I appreciate that there are currently some icons in the floating element, however they do not fit our purpose.

In our implementation there are two treeview components, dragging from left to right the purpose is to link the entities the nodes represent and from left to right to unlink them.

Therefore going from right to left, it is only valid to drop directly onto top level nodes, but going from left to right it is valid to drop anywhere inside the treeview component.

The most plausible way I can see to achieve what I would like to do would be to apply a css class to all nodes in the treeview that are valid drop targets - I would then the floating element to have styles or a class applied to it when it is dragged over valid drop nodes. Is that possible? I can't find any on drag over events exposed.

Perhaps there is some more general interface through which it is possible to customise the rules for what is a valid drop target and give feedback to the user in the UI?



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team September 9, 2022 02:27 PM UTC

Hi Arthur,


We appreciate your patience.


Query#:- which it is possible to customise the rules for what is a valid drop target and give feedback to the user in the UI?


Further analyzing, we don’t have support to customize the dragged tooltip at our end. If you want to prevent drop on certain records by setting args.Cancel based on condition using RowDropped event of the TreeGrid.


Refer to the code below:-

Index.razor:-

 

<SfTreeGrid DataSource="@TreeGridData" AllowRowDragAndDrop="true" TreeColumnIndex="1" IdMapping="TaskId" ParentIdMapping="ParentId" Height="400">

     <TreeGridEvents TValue="WrapData" RowDropped="rowDrop"></TreeGridEvents>         

     <TreeGridSelectionSettings Type="Syncfusion.Blazor.Grids.SelectionType.Multiple"></TreeGridSelectionSettings>

                <TreeGridColumns>

                                

             .      .   .

 

</SfTreeGrid>

 

    public void rowDrop(RowDragEventArgs<WrapData> args)

    {

        args.Cancel = true;

        // Here you can prevent based on condition

    }


Please get back to us if you need any further assistance.


Regards,
Farveen sulthana T


Loader.
Up arrow icon