Hi all,
This issue should be fixed in a few weeks. In the meantime, you can use the following workaround:
<TelerikGrid Data="@GridData" RowDraggable="@CanDrag" Class="@DragClass">
<GridToolBar>
<GridCommandButton OnClick="@ToggleDrag">Toggle Drag</GridCommandButton>
</GridToolBar>
<GridColumns>
<GridColumn Field="@(nameof(TestModel.Name))" />
</GridColumns>
</TelerikGrid>
<style>
.k-grid.hide-drag-column .k-drag-col {
width: 0;
}
.k-grid.hide-drag-column .k-drag-cell {
visibility: hidden;
}
</style>
@code {
bool CanDrag { get; set; } = true;
string DragClass { get; set; } = "hide-drag-column";
void ToggleDrag(GridCommandEventArgs args)
{
CanDrag = !CanDrag;
}
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
CanDrag = false;
DragClass = "";
}
return base.OnAfterRenderAsync(firstRender);
}
IEnumerable<TestModel> GridData { get; set; } = Enumerable.Range(1, 5)
.Select(x => new TestModel {
ID = x, Name = $"Name {x}"
});
public class TestModel
{
public string Name { get; set; }
public int ID { get; set; }
}
}
Regards,
Dimo
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.