Reproduceable example: https://blazorrepl.telerik.com/QSEganvg12BVw2ZU37
Steps to reproduce:
If you remove the GridAggregates emtpy render fragment, or put at least one GridAggregate component in it, OnStateInit fires like expected.
In my project, I've created a component that wraps around the TelerikGrid that I use on all my pages, so that I can have many properties and functions set to reasonable defaults for my use case. My component has an option to conditionally include GridAggregate components within the inner TelerikGrid's GridAggregates render fragment based on separate configuration. If no separate configuration is provided, no GridAggregate components are included, and the GridAggregates render fragment is left blank. Since my component is built in razor markup, there isn't a great option for nulling out that render fragment if it's empty. I had no problems with this exact same code in UI for Blazor version 5.1, and I hope this can be fixed.
Hi,
documentation missing one extremely "silent" breaking change in grid data binding.
When binding/refreshing(subsequent reload) data to VARIABLE, there is "random" need to call grid.Rebind(); Mostly, when data are loaded outside of the grid, ie by some button, or another component. Used together with selected items and grouping enabled.
<TelerikGrid Data="@GridData" SelectionMode="GridSelectionMode.Single" SelectedItems="..."
OnRowClick="@...r" @ref="GHL" ....>
prior v6.0, everything is OK:
protected async Task ReloadGrid(int? xid)
{
GridData= await LoadDatafromservice<TItem>...;
}
After upgrading same code, it silently not displaying data or cras.
new breaking behavior at v6.0 - hotfix, but "ugly one":
protected async Task ReloadGrid(int? xid)
{
GridData= await LoadDatafromservice<TItem>...;
GHL.Rebind(); //required, otherwise grid content(rows) is not update. Later the grid crash when selecting row etc. Old "rows" are still displayed;
}
Its weird to gues, where rebind is needed and where not. Previous versions acting as expected(async - task = no problem).
Make it documented, "what is correct" and when.
Or if it is a bug, please move it out from feature request.
Thanks
Could there be an option to NOT close the filter dropdown when the clear button is pressed? Is there an AutoClose parameter or something else?
I just got a request for this, and their thought is they will have a filter set, then want to click clear, and then still pick new items to filter before leaving the dropdown.Error: System.OverflowException: Value was either too large or too small for a Decimal.
Hi,
when using SetStateAsync(), OnRead is called ok, but loading indicator is not presented as usual.
How to reproduce:
1. button = loading data by SetStateAsync(), no progress indicated.
2. button = loading data throught rebind, is ok
demo is based on https://docs.telerik.com/blazor-ui/components/grid/refresh-data
Expected: same behavior as by button 2. -> Rebind()->OnRead()...loading progress
Thanks
The Grid exits edit mode when expanding or collapsing rows in a hierarchy scenario. This only happens when OnStateChanged is set.
Test page that reproduces the behavior: https://blazorrepl.telerik.com/wIkJvdlo09hXCV8u03
I have the following Grid setup:
Exception: System.ArgumentException: Operator 'IsEqualTo' is incompatible with operand types 'DateOnly?' and 'DateTime'
Hi,
it seems that grid.GetState() and FilterDescriptors, contains +1 "dummy" object.
- If it is by design, ok, BUT then, how to bind this filter descriptor to the ie TelerikFilter? = It displays that dummy object as it is, and confusing end users. Or how to "identify 100%" that is some kind of dummy value to be trashed?
How to reproduce:
1 run the repl demo
2 put "a" into the first colum(Name) filter
3 click button and observe the content of filter descriptors(serialized below the grid - RED is wrong, Green is expected as ok)
similar, but not the same(iam came from here):
Thanks for the tip, clarification, or removing that redundant values.
The header cell includes the following inner elements when the Grid is sortable:
However, if I disable sorting all those elements are omitted which is not consistent.
When the user drags a third column to the Grid Group Panel, it ends up being second, instead of last. It looks like each new column is inserted at index 1, instead of appended last (when this is the user's intent).
@using Telerik.DataSource
<p>Group by a third column, so that it should come last in the Group Panel:</p>
<TelerikGrid @ref="@GridRef"
Data="@GridData"
Pageable="true"
Sortable="true"
Groupable="true"
FilterMode="GridFilterMode.FilterRow"
OnStateInit="@( (GridStateEventArgs<Employee> args) => OnGridStateInit(args) )"
OnStateChanged="@( (GridStateEventArgs<Employee> args) => OnGridStateChanged(args) )">
<GridColumns>
<GridColumn Field="@nameof(Employee.Name)" />
<GridColumn Field="@nameof(Employee.Team)" />
<GridColumn Field="@nameof(Employee.Salary)" />
<GridColumn Field="@nameof(Employee.OnVacation)" />
</GridColumns>
</TelerikGrid>
@code {
private TelerikGrid<Employee>? GridRef { get; set; }
private List<Employee> GridData { get; set; } = new();
private void OnGridStateInit(GridStateEventArgs<Employee> args)
{
args.GridState.GroupDescriptors = new List<GroupDescriptor>();
args.GridState.GroupDescriptors.Add(new GroupDescriptor()
{
Member = nameof(Employee.Team),
MemberType = typeof(string)
});
args.GridState.GroupDescriptors.Add(new GroupDescriptor()
{
Member = nameof(Employee.OnVacation),
MemberType = typeof(bool)
});
}
private async Task OnGridStateChanged(GridStateEventArgs<Employee> args)
{
if (args.PropertyName == "GroupDescriptors" && args.GridState.GroupDescriptors.Count > 2 && GridRef != null)
{
var secondGroupDescriptor = args.GridState.GroupDescriptors.ElementAt(1);
args.GridState.GroupDescriptors.Remove(secondGroupDescriptor);
args.GridState.GroupDescriptors.Add(secondGroupDescriptor);
await GridRef.SetStateAsync(args.GridState);
}
}
protected override void OnInitialized()
{
var rnd = new Random();
for (int i = 1; i <= 20; i++)
{
GridData.Add(new Employee()
{
Id = i,
Name = "Name " + i,
Team = "Team " + (i % 4 + 1),
Salary = (decimal)rnd.Next(1000, 3000),
OnVacation = i % 3 == 0
});
}
}
public class Employee
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Team { get; set; } = string.Empty;
public decimal Salary { get; set; }
public bool OnVacation { get; set; }
}
}
On grids with a lot of data there is a delay between when the grid is assigned the data to when the grid shows the data. During this UI painting period, the NoDataTemplate is displayed for a second or two.
The grid should not show the NoDataTemplate unless the data source is loaded with an empty collection, not just while it is still trying to show the data.
Note: Having a generic message like in the documentation "No Data available / The data is still loading ..." is not satisfying our users. (Blazor Grid - No Data Template - Telerik UI for Blazor) These should really be two different states that can show different messages.
Thanks
When a user deletes a record that decreases the number of pages on that Grid, and then they try to edit or add a record, they get stuck in the OnCancel event handler, which gets called over and over in an endless loop.
The behavior can be seen:
Steps To Reproduce
https://blazorrepl.telerik.com/GokIvFva42BLx7yl37
1. Delete item 11. The Grid will move you to page 1.
2. Try to edit or add a new item. OnCancel will fire in a loop.
3. If OnAdd and OnEdit are not defined, the loop will occur in OnUpdate and OnCancel.
I want to compare special characters (such as umlauts) to other user input.
I have a TelerikGrid that contains many columns and a DetailTemplate within it. The Grid has functionality for multiselect with a checkbox column that appears as the first column on the grid. Is it possible to move this checkbox column in front of the detail template '+' dropdown row?
===
ADMIN EDIT
===
A possible option for the time being is to create a custom expand column and manage its position as needed. See more details and an example here: How to Reorder, Lock or Resize the Hierarchy Expand/Collapse Column in Telerik Blazor Grid.
We want frozen columns exactly like this: