Hi Richy,
We have checked your reported query. We can achieve your requirement using JSInterop. Please refer below code snippets.
|
@using Syncfusion.Blazor.Buttons
@inject IJSRuntime JSRuntime;
<SfButton ID="movebutton" Content="Move" CssClass="e-success" Created="Created"></SfButton>
@code {
private async Task Created()
{
await JSRuntime.InvokeVoidAsync("movebutton");
}
}
_host.cshtml
<!DOCTYPE html>
<html lang="en">
<head>
<link rel='nofollow' href="_Content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" />
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/ej2-base/styles/material.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<script>
function movebutton() {
var dragElement = document.getElementById('movebutton');
var draggable = new ej.base.Draggable(dragElement, { clone: false });
}
</script>
</body>
</html> |
For your reference, we have prepared a sample based on this. Please refer below link.
Please let us know, if you need any further assistance.
Regards,
Mohan kumar R