In many scenarios, when the user doesn't need the group option, we think it is better to have the drop area hidden. This was achieved by assigning a bool var to "AllowGrouping" and letting the user toggle it. It was working fine but now, after the updates it doesn't. The drop area does show and hide but any column to be grouped can't be dropped anymore. Please, see attached video showing that it was working before and below is a simplified sample that although it is not the one showed in the video it uses exactly the same code.
@page "/ZLabTest/TestingPage"
<div style="padding-top: 5px;padding-bottom: 5px;">
<SfButton OnClick="@(() => { allowGroup = !allowGroup; })" Content="Group / Ungroup"></SfButton>
@allowGroup.ToString()
</div>
<div style="width: calc(100vw - 20rem);">
<SfGrid DataSource="@Orders" AllowPaging="true" Height="100%" Width="100%" AllowGrouping="@allowGroup">
<GridEvents TValue="Order"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="yMd" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.ShipCountry) HeaderText="Ship Country" Width="150"></GridColumn>
</GridColumns>
</SfGrid>
</div>
@code{
protected bool allowGroup = false;
public List<Order> Orders { get; set; }
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
ShipCountry = (new string[] { "USA", "UK", "JAPAN" })[new Random().Next(3)]
}).ToList();
}
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
public string ShipCountry { get; set; }
}
}