dotnet/aspnetcore

In Blazor ! How do we perform (Drag & Drop) & (Resizing) in Server-side application.

Indrajith-Sync opened this issue · 10 comments

Describe the solution you'd like

Is there any way to perform the Drag & Drop, Resizing in the Serve-side approach with the blazor.

Additional context

Can anyone suggest a solution for it ?

You will have to use jsinterop for this, maybe search for package on nuget there must be something about it. I found this repo with some sample code from @chrissainty https://github.com/chrissainty/SimpleDragAndDropWithBlazor

I covered some drag and drop investigation I did in this blog post (which accompanies the repo @RemiBou has linked above). The solution I have in the repo and the blog post avoids using JS interop but there are limitations. For example, I couldn't find a good way to handle ordering via drag and drop.

@chrissainty later I checked you blog post. It is useful.
I there any way to Resize the element in blazor native way ?

@chrissainty Tried running your shared github repo for the drag and drop demo. Currently i am using RC1 version of blazor and from the preview 9 update this lambda expression error is thrown on passing the function call with some arguments like below.

@ondragstart="@(() => HandleDragStart(JobModel))"

Facing the below script error while launching the project in VS.
image

Can you please update your comments on it ?

@indrajjith I've updated the code to work with RC1.

@chrissainty It works now. thanks..!

@chrissainty Do you have any suggestion for element Resize in Blazor native way ?

@indrajjith You can resize elements using CSS (https://www.w3schools.com/cssref/css3_pr_resize.asp). But I don't think the onresize event is available in Blazor yet. So you would need to use some JS Interop.

Seems that the question has been answered. We can close this.