In a grouped Grid with Incell editing if I collapse all groups and then expand one to edit an item in it, once I press Enter to complete the editing all groups expand.
Please add option for persisting the Collapsed State of the groups.
---I found a workaround to this issue.
First I have a TelerikGrid reference in my code behind and a property to store the grid state (which includes grouping and collapsed groups):
private TelerikGrid<RiskRegister>? RiskRegisterGridEl { get; set; }
private GridState<RiskRegister>? GridState { get; set; }
When the OnUpdate event callback of the TelerikGrid is fired, I save the grid state:
GridState = RiskRegisterGridEl?.GetState();
Then, I added a listener to the OnStateChanged event callback of the TelerikGrid. This event is fired for multiple reasons, so I only target the "EditItem" scenario. At that point, I re-set the grid state using the previously saved one. This is the method fired OnStateChanged:
private async Task OnGridStateChanged(GridStateEventArgs<RiskRegister> args)
{
if (args.PropertyName == "EditItem" && RiskRegisterGridEl != null)
{
await RiskRegisterGridEl.SetStateAsync(GridState);
}
}
There is one downside to this. On saving the row, the grid will quickly expand all groups and then go back to the desired state.
Hope this helps
Another example is here
https://blazorrepl.telerik.com/QSOCkMbc32QeyZov07
Group by any column, collapse some groups and click Add or Remove button.
I strongly suggest Telerik would look into implementing this on their next release. Without this, Grid functionality is incomplete.
Hien