Planned
Last Updated: 06 Sep 2024 07:40 by ADMIN
Scheduled for 2024 Q4 (Nov)

When using the Filter Menu inside the Column Menu filter value is reset if Rebind is called. For reference, if using FIlter Row or a standalone Filter Menu value is not reset upon invoking Rebind.

Reproduction: https://blazorrepl.telerik.com/mdOJYHas48vPCPUv47.

Unplanned
Last Updated: 04 Sep 2024 10:18 by Mehdi

I want to filter a Grid by DateTimeOffset? field

 

===ADMIN EDIT===

There are two possible options:

1. Use a DTO in which you have a DateTime field converted as desired by your app from the DateTimeOffset. Filtering, sorting, editing, and grouping on DateTime values are supported out-of-the-box.

REPL example that demonstrates this approach. 

2. Use the Grid Filter Template. As a filter editor, you can use the DateTimePicker component, which supports the DateTimeOffset type. 

REPL example that demonstrates this approach. 

 

 

Planned
Last Updated: 04 Sep 2024 06:24 by ADMIN
Scheduled for 2024 Q4 (Nov)

Consider this test page: https://blazorrepl.telerik.com/cSEQOTQY53LRL4je36

  1. Check some checkboxes for the Name column and click on the Filter button. This works as expected.
  2. Uncheck all checkboxes in the Name column checkbox list and click on the Filter button again. This time, the previously checked checkboxes remain checked and the filters remain applied.

This happens only when using a column menu - ShowColumnMenu="true".

===

A possible workaround is to use a FilterButtonsTemplate and clear the filters programmatically if the filter descriptor is empty:

@using Telerik.DataSource
@using Telerik.DataSource.Extensions
 
<TelerikGrid TItem="@Employee"
             OnRead="@OnReadHandler"
             Pageable="true"
             FilterMode="@GridFilterMode.FilterMenu"
             FilterMenuType="@FilterMenuType.CheckBoxList"
             ShowColumnMenu="true"
             Height="400px">
    <GridColumns>
        <GridColumn Field="@(nameof(Employee.EmployeeId))" Filterable="false" />
        <GridColumn Field="@nameof(Employee.Name)">
            <FilterMenuTemplate Context="context">
                <TelerikCheckBoxListFilter Data="@NameOptions"
                                           Field="@(nameof(NameFilterOption.Name))"
                                           @bind-FilterDescriptor="@context.FilterDescriptor">
                </TelerikCheckBoxListFilter>
            </FilterMenuTemplate>
            <FilterMenuButtonsTemplate Context="filterContext">
                <TelerikButton OnClick="@( async () => await ApplyFilterAsync(filterContext) )"
                               ThemeColor="primary">Filter</TelerikButton>
                <TelerikButton OnClick="@( async () => await ClearFilterAsync(filterContext) )">Clear</TelerikButton>
            </FilterMenuButtonsTemplate>
        </GridColumn>
        <GridColumn Field="@nameof(Employee.Team)" Title="Team">
            <FilterMenuTemplate Context="context">
                <TelerikCheckBoxListFilter Data="@TeamsList"
                                           Field="@(nameof(TeamNameFilterOption.Team))"
                                           @bind-FilterDescriptor="@context.FilterDescriptor">
                </TelerikCheckBoxListFilter>
            </FilterMenuTemplate>
        </GridColumn>
        <GridColumn Field="@nameof(Employee.IsOnLeave)" Title="On Vacation" />
    </GridColumns>
</TelerikGrid>

@code {
    List<Employee> AllGridData { get; set; }

    #region custom-filter-data
    List<TeamNameFilterOption> TeamsList { get; set; }
    List<NameFilterOption> NameOptions { get; set; }

    private async Task ApplyFilterAsync(FilterMenuTemplateContext filterContext)
    {
        var hasFilters = filterContext.FilterDescriptor.FilterDescriptors.OfType<FilterDescriptor>().Any(x => !string.IsNullOrEmpty(x.Value.ToString()));

        if (hasFilters)
        {
            await filterContext.FilterAsync();
        }
        else
        {
            await filterContext.ClearFilterAsync();
        }
    }

    private async Task ClearFilterAsync(FilterMenuTemplateContext filterContext)
    {
        await filterContext.ClearFilterAsync();
    }

    //obtain filter lists data from the data source to show all options
    async Task GetTeamOptions()
    {
        if (TeamsList == null) // sample of caching since we always want all distinct options,
                               //but we don't want to make unnecessary requests
        {
            TeamsList = await GetNamesFromService();
        }
    }

    async Task<List<TeamNameFilterOption>> GetNamesFromService()
    {
        await Task.Delay(500);// simulate a real service delay

        // this is just one example of getting distinct values from the full data source
        // in a real case you'd probably call your data service here instead
        // or apply further logic (such as tie the returned data to the data the grid will have according to your business logic)
        List<TeamNameFilterOption> data = AllGridData.OrderBy(z => z.Team).Select(z => z.Team).
            Distinct().Select(t => new TeamNameFilterOption { Team = t }).ToList();

        return await Task.FromResult(data);
    }

    async Task GetNameOptions()
    {
        if (NameOptions == null)
        {
            NameOptions = await GetNameOptionsFromService();
        }
    }

    async Task<List<NameFilterOption>> GetNameOptionsFromService()
    {
        await Task.Delay(500);// simulate a real service delay

        List<NameFilterOption> data = AllGridData.OrderBy(z => z.Name).Select(z => z.Name).
            Distinct().Select(n => new NameFilterOption { Name = n }).ToList();

        return await Task.FromResult(data);
    }
    #endregion custom-filter-data

    async Task OnReadHandler(GridReadEventArgs args)
    {
        //typical data retrieval for the grid
        var filteredData = await AllGridData.ToDataSourceResultAsync(args.Request);
        args.Data = filteredData.Data as IEnumerable<Employee>;
        args.Total = filteredData.Total;
    }

    protected override async Task OnInitializedAsync()
    {
        AllGridData = new List<Employee>();
        var rand = new Random();
        for (int i = 1; i <= 15; i++)
        {
            AllGridData.Add(new Employee()
            {
                EmployeeId = i,
                Name = "Employee " + i.ToString(),
                Team = "Team " + i % 3,
                IsOnLeave = i % 2 == 0
            });
        }

        await GetTeamOptions();
        await GetNameOptions();
    }

    public class Employee
    {
        public int EmployeeId { get; set; }
        public string Name { get; set; }
        public string Team { get; set; }
        public bool IsOnLeave { get; set; }
    }

    // in this sample we use simplified models to fetch less data from the service
    // instead of using the full Employee model that has many fields we do not need for the filters

    public class TeamNameFilterOption
    {
        public string Team { get; set; }
    }

    public class NameFilterOption
    {
        public string Name { get; set; }
    }
}

Unplanned
Last Updated: 03 Sep 2024 12:49 by Emmett
Created by: Brian
Comments: 5
Category: Grid
Type: Feature Request
25
I would like to use the endless scrolling feature (like in the Telerik UI for jQuery) with the Telerik Blazor Grid.
Completed
Last Updated: 03 Sep 2024 05:39 by ADMIN
Release 2024 Q4 (Nov)

I have a Grid with Navigable="true" and FilterRow. If I focus a string filter input and press the left/right arrow keys, the focus moves away from the cell. This behavior also occurs when I press up/down arrows in numeric filter inputs.

Reproduction: https://blazorrepl.telerik.com/GcvPkekt36Mxgygv07

Completed
Last Updated: 02 Sep 2024 12:51 by ADMIN
Release 2024 Q4 (Nov)

I am using InCell Grid editing. I want to prevent an edit cell from closing on certain condition. However, when I cancel the update with args.IsCancelled = true in OnUpdate, the user can still close the edited cell with Enter or Tab. This is inconsistent with inline or popup editing.

===

A possible workaround is to cancel both OnUpdate and the subsequent OnEdit.

https://blazorrepl.telerik.com/QykMHkks10APuDLQ47

@using System.ComponentModel.DataAnnotations

<TelerikGrid Data="@GridData"
             EditMode="@GridEditMode.Incell"
             OnEdit="@OnGridEdit"
             OnUpdate="@OnGridUpdate">
    <GridColumns>
        <GridColumn Field="@nameof(SampleModel.Name)" />
        <GridColumn Field="@nameof(SampleModel.Min)" />
        <GridColumn Field="@nameof(SampleModel.Max)" />
    </GridColumns>
</TelerikGrid>

<TelerikNotification @ref="@NotificationRef"
                     HorizontalPosition="@NotificationHorizontalPosition.Center"
                     VerticalPosition="@NotificationVerticalPosition.Top" />

@code {
    private TelerikNotification? NotificationRef { get; set; }

    private List<SampleModel> GridData { get; set; } = new();

    private bool ShouldCancelOnEdit { get; set; }

    private int LastId { get; set; }

    private void OnGridEdit(GridCommandEventArgs args)
    {
        if (ShouldCancelOnEdit)
        {
            ShouldCancelOnEdit = false;
            args.IsCancelled = true;
        }
    }

    private void OnGridUpdate(GridCommandEventArgs args)
    {
        var updatedItem = (SampleModel)args.Item;

        if (updatedItem.Min > updatedItem.Max)
        {
            NotificationRef?.Show(new NotificationModel()
            {
                ThemeColor = ThemeConstants.Notification.ThemeColor.Error,
                Text = "Min must be smaller than Max"
            });

            args.IsCancelled = true;
            ShouldCancelOnEdit = true;
        }
        else
        {
            var originalItemIndex = GridData.FindIndex(i => i.Id == updatedItem.Id);

            if (originalItemIndex != -1)
            {
                GridData[originalItemIndex] = updatedItem;
            }

            ShouldCancelOnEdit = false;
        }
    }

    protected override void OnInitialized()
    {
        for (int i = 1; i <= 5; i++)
        {
            GridData.Add(new SampleModel()
            {
                Id = ++LastId,
                Name = $"SampleModel {LastId}",
                Min = Random.Shared.Next(1, 10),
                Max = Random.Shared.Next(11, 20)
            });
        }
    }

    public class SampleModel
    {
        public int Id { get; set; }
        [Required]
        public string Name { get; set; } = string.Empty;
        public int Min { get; set; }
        public int Max { get; set; }
    }
}

Completed
Last Updated: 02 Sep 2024 09:49 by ADMIN
Release 2024 Q4 (Nov)
Created by: Hao
Comments: 0
Category: Grid
Type: Bug Report
13

The select-all functionality of the Grid is slow in WebAssembly apps, when SelectAllMode="GridSelectAllMode.All".

A possible workaround is to use a CheckBoxColumn HeaderTemplate.

Completed
Last Updated: 02 Sep 2024 09:44 by ADMIN
Release 2024 Q4 (Nov)
Sometimes when using virtual columns, double clicking to resize the column makes wrong calculations, the scroll resets or goes away altogether.
Completed
Last Updated: 29 Aug 2024 12:12 by ADMIN
Release 2024 Q4 (Nov)

Error:

blazor.server.js:19 [2021-02-03T06:17:43.996Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Components.Common.Filters.FilterList.TelerikFilterList.GetFilterOperators()
   at Telerik.Blazor.Components.Common.Filters.FilterList.TelerikFilterList.InitFilterOperators()
   at Telerik.Blazor.Components.Common.Filters.FilterList.TelerikFilterList.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
e.log @ blazor.server.js:19
C @ blazor.server.js:8
(anonymous) @ blazor.server.js:8
(anonymous) @ blazor.server.js:1
e.invokeClientMethod @ blazor.server.js:1
e.processIncomingData @ blazor.server.js:1
connection.onreceive @ blazor.server.js:1
i.onmessage @ blazor.server.js:1

 

Example:

private string SerializedState; private void OnStateInitHandler(GridStateEventArgs<SampleData> args) { args.GridState = JsonSerializer.Deserialize<GridState<SampleData>>(SerializedState); }

 

Reason:

FilterDescriptors property MemberType = null.

 

Note:

Method TelerikGrid.SetState() works correctly.

 

 

 

Completed
Last Updated: 29 Aug 2024 11:51 by ADMIN
Release 2024 Q4 (Nov)
Created by: Torsten
Comments: 0
Category: Grid
Type: Bug Report
10

---

ADMIN EDIT

A sample reproducible is attached.

The issue stems from the inability of the System.Text.Json serializer to work with fields of type "Type" and the filter descriptors have such a field to denote the type of the column. Whether it will be possible for the grid to work around needs to be researched in more detail, because the limitation comes from the framework.

Might be the same problem as the following thread that also offers a few workarounds one can consider: https://feedback.telerik.com/blazor/1505237-set-deserialized-grid-state-in-onstateinit-handler-cause-error-on-open-filter-menu-of-column-on-ui

---

Unplanned
Last Updated: 29 Aug 2024 08:23 by ADMIN
The current Blazor Grid does not support selection of multiple ranges of items in a grid. When executing the following steps  (example is from https://docs.telerik.com/blazor-ui/components/grid/selection/rows) I would expect the row of 'Employee 9' to be selected too, but this is not the case. Therefor a request to make it possible to use the combination Ctrl + Shift in combination with the grid selection to select multiple ranges of items. This would be the same behavior as in Windows Explorer for example.
Unplanned
Last Updated: 28 Aug 2024 13:57 by Leland

When I override the IsValid method to return a ValidationResult the Incell & Inline edit modes allow the editing to be continued even if an invalid value is present. 

===

Telerik edit: A possible workaround is to cancel OnUpdate and possibly, OnEdit too. Here is a complete example:

https://blazorrepl.telerik.com/QyaWxkvv10stL8jB06

 

Pending Review
Last Updated: 26 Aug 2024 12:19 by ADMIN

Currently the GridSearchBox is able to search in all of the visible columns but when it comes to searching in multiple columns split by space it does not work. Or even two different strings in the same cell.

Example:

If from the above grid, I type in the search box, "LT" three products will be returned but if I type "LT LD" it should return two products but the results set comes with nothing.

I have implemented CustomSearchBox component as a solution in the interim to achieve this functionality. But it would be a worthwhile effort to have this functionality out of the box.

Thank you.

 

Sheraz

Unplanned
Last Updated: 23 Aug 2024 12:50 by Mattia

I am using Grid with Cell Selection enabled and DragToSelect="true". If I define a Template inside the GridColumn tag and I add a div inside that, SelectedCellsChanged event handler does not trigger if I start dragging by clicking on the div or if I drop inside that one.

Reproduction: https://blazorrepl.telerik.com/myasmnvQ46Jt7k5n50.

===

ADMIN EDIT

===

The only workaround for the time being is to disable the drag selection and let the user only select cells by clicking them. The cells will be selected even if the user clicks on the custom <div> element inside the template.

Planned
Last Updated: 20 Aug 2024 16:57 by ADMIN
Scheduled for 2024 Q4 (Nov)
Created by: Peter
Comments: 0
Category: Grid
Type: Feature Request
7

Feature Request

Currently, when a grid is rendered with 500 rows in a WASM application and expand/collapse action is initiated, it takes a few seconds to finish grouping and rendering. 

Steps to reproduce

1. Create a grid in WASM app.
2. Add 500 rows.
3. Do not enable paging.
4. Group by any field and initiate expand/collapse.
5. All rows are re-rendered which leads to a few seconds delay.

 

 

Declined
Last Updated: 20 Aug 2024 13:24 by Ze

It would be good to have a Grid parameter like "ExpandDetailsOnSelection" for the Grid:

-> When the user selects a row, the DetailTemplate automatically expands - the DetailTemplate of the previous selected item is automatically collapsed

Advantages:

- no "+" button needed

- easy to integrate for 2-way-binding on SelectedItems (no need to use GridState and RowClick event)

Unplanned
Last Updated: 20 Aug 2024 07:36 by Sheraz
Created by: Simi
Comments: 1
Category: Grid
Type: Feature Request
15

Hello,

Please consider a Grid feature that changes the component layout on mobile devices or narrow screens. The idea is to switch the column layout to a card layout or anything similar to this example: https://css-tricks.com/responsive-data-tables/

It is possible to implement a similar behavior with the Telerik Blazor Grid and MediaQuery components, but it requires reusing the column titles in the CSS code: https://blazorrepl.telerik.com/GnYPmHFR176Jg5Yg02

===

Telerik Blazor team: Everyone who is interested in this feature, please vote for it to help us prioritize. Also, share your opinion about which Grid features you strictly need in the "mobile" layout and which ones you are ready to sacrifice. Some features don't make sense in a card / listview layout anyway, but still, the mobile-friendly Grid may require completely different HTML markup and UX, so some features may need to be completely revamped.

Completed
Last Updated: 16 Aug 2024 05:32 by ADMIN
In Incell edit mode you have to click twice on the cell to focus it and the soft keyboard to appear.
Unplanned
Last Updated: 15 Aug 2024 12:39 by Lee
Created by: Rac
Comments: 3
Category: Grid
Type: Feature Request
6

Hello,

Currently the Id and Field properties of GridColumnState in the GridState do not have setters. As a result, these properties are not deserialized, e.g. when sending GridState information from the client to the server in WebAssembly apps.

I would like to determine the existing columns in the Grid and tailor the database request, so that the fetched data includes only the required columns.

Another possible use case is detecting outdated GridState information in localStorage, after the app has been updated and the Grid contains different columns.

Completed
Last Updated: 15 Aug 2024 12:33 by David
Release 5.1.0 (31 Jan 2024) (R1 2024)
Hello,

We have a Blazor Telerik Grid with DetailTemplate. One of the columns in Master/Parent is an editable column. The grid is set with "Incell" for property 'EditMode'.

Issue:-

When the editable column is clicked for editing, the entire grid row(with detail) is collapsed if the row is in expanded mode. Once editing is completed, the grid goes back to its previous state(expanded).

Editing parent column in collapsed mode, works without any issues.

Would like to know if I can keep the grid row in expanded mode while editing(ie. keep the  original state) if its in expanded state.

If not, is it the default behavior of hierarchy grid and how can it be overridden?

Note - Tried with OnEdit and OnRowClick events, but the collapse happens before the respective event handler call.

Thanks in advance !

Sreeni
1 2 3 4 5 6