Declined
Last Updated: 03 Apr 2023 11:07 by ADMIN
Created by: Clark
Comments: 1
Category: Grid
Type: Bug Report
1

Problem

It seems the Grid and GridSearchBox assume the search string by taking the value of GridState.SearchFilter.FilterDescriptors[0].Value and this is causing a few issues:

  1. If the first filter is a CompositeFilterDescriptor, it causes an exception.
  2. If there is no filter, the search box gets cleared.
  3. If the first filter has a different value than what was typed (because filters were added/changed programmatically), the search box value will be changed.

Background

I am expanding grid search to include non-string columns, and I want this to apply by default across our entire application without having to update every grid individually or developers having to remember to opt in.

To search other type columns, I’ve largely taken the logic from Search Grid in numeric and date fields - Telerik UI for Blazor and it works well. However, that solution utilizes a custom search box component that I would have to add to each grid.

Instead, I have placed this filter creation logic in the OnStateChanged handler as exemplified in How to Search Grid Items with a StartsWith Filter Operator - Telerik UI for Blazor, as we already have a handler for this event that all grids utilize.

This has worked wonderfully except for the issues I’ve mentioned.

Issue #1 – CompositeFilterDescriptor causes exception

If the first filter is a CompositeFilterDescriptor, it causes an exception. Specifically:

Unable to cast object of type 'Telerik.DataSource.CompositeFilterDescriptor' to type 'Telerik.DataSource.FilterDescriptor'.
   at Telerik.Blazor.Components.Common.TableGridBase`2.LoadSearchFilter(IFilterDescriptor descriptor)
   at Telerik.Blazor.Components.TelerikGrid`1.SetStateInternal(GridState`1 state)
   at Telerik.Blazor.Components.TelerikGrid`1.<SetStateAsync>d__311.MoveNext()
   at Web.Pages.Grid.<OnStateChangedHandler>d__18.MoveNext() in C:\src\Web\Pages\Grid.razor:line 196

If there is another filter in the collection that is not a CompositeFilterDescriptor, I can work around this problem by moving it to the front of the list.

// Make sure first filter is not composite.
var nonCompositeFilter = newSearchFilter.FilterDescriptors.OfType<FilterDescriptor>().FirstOrDefault();
if (nonCompositeFilter is not null && newSearchFilter.FilterDescriptors[0] is CompositeFilterDescriptor)
{
    newSearchFilter.FilterDescriptors.Remove(nonCompositeFilter);
    newSearchFilter.FilterDescriptors.Insert(0, nonCompositeFilter);
}

However, if all filters are composite, the exception is unavoidable.

Issue #2 – Search box gets cleared

If the GridState.SearchFilter.FilterDescriptors collection is empty, the search box gets cleared. This is a problem when a user needs to type more characters for a filter to be created.

For example, let’s say you are only searching DateTime columns and using the logic from Search Grid in numeric and date fields - Telerik UI for Blazor. As you type, it checks to see if the input is an integer between 1000 and 2100. Until you type the fourth digit, it will not meet that condition thus will not add a filter. So if you begin by typing “2”, it searches and a filter will not be added yet. However, because there are no filters, it will clear the search box. You won’t be able to type out a full year value of “2023” unless you type fast enough to outpace the debounce delay.

Issue #3 – Search box gets changed

Using the same example as above but with an Enum column instead of a DateTime, begin typing text. If the text matches an enum name, a filter is added for the enum item’s underlying value. For example:

  1. Type “e”.
  2. The first enum item’s name matches “e”, so a filter is added for (int)item IsEqualTo 0.
  3. The search box text is replaced with “0”.

Possible solutions?

  1. Is there some sort of “dummy” filter descriptor I could add to the beginning of the FilterDescriptors collection? Like, it would contain the search string as the Value but it would always evaluate to true and never affect which records match?
  2. I give in and create a custom search box component to hold the search string value separate from GridState, which would require me to update every current and future grid after all.
  3. Telerik could add a SearchString property to the GridState separate from the SearchFilter so that any filter changes would not affect the search string. Or something.

Sample project attached.

Completed
Last Updated: 08 Jun 2023 08:08 by ADMIN
Release 4.4.0 (07/19/2023) (R3 PI1)
Created by: Michal
Comments: 7
Category: Grid
Type: Bug Report
5

Hello,

 new version has broken "dynamic" changing column properties/visiblity runtime, especially- selection mode and causing lot of "rerendering".

Video attachment:
1 - first part is OLD version(prior 4.1.0) 4.0.1
2 - seccond part(after changing next browser tab) is new version 4.1.0

SAME setup
Iam already using hint for blazor with IDs of columns, found in Your documentation...etc. @key="@("sIDX")"

.....

-->>Clicking on Button for changing grid mode and visibility of columns**
<TelerikToggleButton Title="Oznaceni vice radku" Icon="@FontIcon.ListUnordered" OnClick="@( _  =>{ CurrentStackItem.gSelectionMode=(CurrentStackItem.gSelectionMode==GridSelectionMode.Multiple)?GridSelectionMode.Single:GridSelectionMode.Multiple;CurrentStackItem.gSelectedItems = Enumerable.Empty<ExpandoObject>();})"
Selected="@(CurrentStackItem.gSelectionMode==GridSelectionMode.Multiple)"></TelerikToggleButton>

....
<GridColumns>

-->>First "static" 2 columns**

<GridCheckboxColumn Visible=@(CurrentStackItem.gSelectionMode==GridSelectionMode.Multiple) @key="@("sIDX")" Width="70px" Locked="true" SelectAll="true" SelectAllMode="GridSelectAllMode.Current"></GridCheckboxColumn><GridColumn FieldType=@typeof(bool) Visible=@(IsPicker==true || (XSmall==false && CurrentStackItem.gSelectionMode==GridSelectionMode.Single )) @key="@("sCMD")" Filterable="false" Sortable="false" Locked="true" Width="@((IsPicker==true && XSmall==true)?"45px":"120px")"> <HeaderTemplate>&nbsp;</HeaderTemplate><Template Context="ctx"><div @onclick:preventDefault="true" @onclick:stopPropagation="true"> -->> THIS part is hitting LOT OF TIME in debug (expected is at best only once) @{if (XSmall==false) { -->> here is LOT OF dynamic buttons. } </div></Template></GridColumn> -->> rest of the dynamic columns. In video, starting with "ciiislo org" in header

@if (GridDef.ColStore != null && GridDef.ColStore.Any()) { foreach (var it in GridDef.ColStore.Where(x => x.Verejny == true)) { <GridColumn @key=@it.FldName Field=@it.FldName FieldType=@it.FldType Title=@it.VerejnyNazev ShowFilterCellButtons="false" Width=@it.cSirkaSestava TextAlign=@it.cZarovnani ><FooterTemplate> @if (it.Sumovat == true) { @context.Sum } </FooterTemplate></GridColumn> } } </GridColumns>

Feel free to change the Subject.

Thanks, have a nice day

Won't Fix
Last Updated: 07 Oct 2024 15:43 by ADMIN
Completed
Last Updated: 23 Feb 2024 10:42 by ADMIN
Release 4.3.0 (06/07/2023) (R2 2023)

Triggering Edit in a Grid bound to a DataTable or ExpandoObject and with edit mode set to Popup throws an unhandled exception. This started to occur in 4.1.0 - the same code runs fine on 4.0.1

To reproduce:

  1. run https://blazorrepl.telerik.com/cduHQkPS34V0enTc50 (note this is the DataTable demo, but with changed edit mode)
  2. trigger edit mode
  3. observe the unhandled exception
Unplanned
Last Updated: 20 Mar 2023 10:54 by Michael

Imagine a Grid with two editable columns, which are separated by a few non-editable ones. In the standard use case, tabbing from the first editable column should jump over the non-editable columns, and the user should end up in the second editable column.

However, if the Grid uses virtual columns and the second editable column is not rendered, tab-to-edit will stop working.

Unplanned
Last Updated: 15 Mar 2023 11:53 by Jakub
Expose a parameter that allows changing the default behavior of the CheckboxList filters. Currently, all distinct options are included in the CheckBoxList. It would be useful if we can configure this and make the filters cascade like in an excel table.
Completed
Last Updated: 14 Nov 2024 09:26 by ADMIN
Release 7.0.0

I have enabled the Column Menu and I am using a Filter Menu Template with only one TextBox. With this setup I am able to only type one letter before the Filter Context is reset.

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

Completed
Last Updated: 14 Mar 2023 12:09 by ADMIN

Hello,

I seem to have stubled upon a strange bug in TelerikGrid. We have wrapped a TelerikGrid and the Columns are also wrapped to allow special actions.
The bug is present in "raw-telerik-code" as well.

We have an edge case where we have a TelerikGrid and some of its columns should be Locked (Stickied/Frozen) as a default behaviour.
But depending on user interaction we want to change the state. We cannot use a property for each column that we want to be Locked/Unlocked as it should be handled by the GridState.

When the Column is using default behaviour (not Templated), it works as intended. But as soon as you use a <Template> for the Column, the Locked state cannot be changed from the default/supplied value.

TLDR: Programmatically changing the Locked state of a column where the cell is templated will not change the locked state.

I have prepared two REPL examples. One for 3.7.0 as it is what we currently are using, and one for 4.0.1 as to prove that it still exists in the current itteration.

3.7.0
https://blazorrepl.telerik.com/cHEHurlI06olUsJ410


4.0.1
https://blazorrepl.telerik.com/cdYRuBvo07aB6BGY39

 

With best regards

Unplanned
Last Updated: 06 Mar 2023 11:53 by Peter

Currently, the Grid doesn't display its built-in loading animation on initial data (page) load.

The OnRead handler is now completely decoupled with the Data parameter, so the limitation can be removed at least for OnRead scenarios.

Unplanned
Last Updated: 28 Feb 2023 09:21 by Valentin
Created by: Valentin
Comments: 0
Category: Grid
Type: Feature Request
3

We found out during SQL profiling that when bound to an IQueryable (linked to DbContext) with pagination enabled, the Telerik data grid called SQL to count elements twice. This is not a pre-render problem as those deplicated queries are actually executed twice (one pair for each render).

Our simplified code:

<TelerikGrid TItem="Item"
             Data="_data"
             PageSize="10"
             Pageable="true"
             Sortable="true">
    <GridColumns>
        <GridColumn Field="@nameof(Item.Id)" />
        <GridColumn Field="@nameof(Item.Code)" />
    </GridColumns>
</TelerikGrid>

@code {
    [Inject] protected DbContext DbContext { get; set; }

    private IEnumerable<Item> _data;

    protected override void OnInitialized()
    {
        base.OnInitialized();
        _data = DbContext.Items
            .Select(x => new Item()
            {
                Id = x.Id,
                Code = x.Code
            });
    }
}

===

ADMIN EDIT:

There are two possible ways to avoid the double COUNT:

  • Enumerate the collection before binding the Grid. For example, call ToList().
  • Bind the Grid via OnRead event. This gives full control over the data binding process and possible optimizations.
Unplanned
Last Updated: 23 Feb 2023 07:16 by Christian

When the user tries to edit a cell in the Grid an exception is thrown. This happens if the Model to which the Grid is bound has an indexer property.

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

===

A possible workaround is to map the data to a collection of a different type that has no indexer property: https://blazorrepl.telerik.com/cxaGwcOC383PD8Jr24

 

Completed
Last Updated: 12 Feb 2025 16:03 by ADMIN
Release 8.0.0
Created by: David
Comments: 1
Category: Grid
Type: Bug Report
7

When the Grid is databound via OnRead event, the initially displayed aggregates are wrong and take into account the first page only.

A possible workaround is to bind the Grid in OnAfterRenderAsync -

@using Telerik.DataSource
@using Telerik.DataSource.Extensions

<TelerikGrid @ref="@GridRef"
             OnRead="@OnGridRead"
             TItem="@Product"
             Pageable="true">
    <GridAggregates>
        <GridAggregate Field="@nameof(Product.Name)" Aggregate="@GridAggregateType.Count" FieldType="@(typeof(System.String))" />
    </GridAggregates>
    <GridColumns>
        <GridColumn Field="@nameof(Product.Name)" Title="Product Name">
            <FooterTemplate>
                @context.Count
            </FooterTemplate>
        </GridColumn>
        <GridColumn Field="@nameof(Product.Price)" />
        <GridColumn Field="@nameof(Product.ReleaseDate)" Title="Release Date" />
        <GridColumn Field="@nameof(Product.Active)" />
    </GridColumns>
</TelerikGrid>

@code {
    TelerikGrid<Product> GridRef { get; set; }
    List<Product> GridData { get; set; }

    bool ShouldBindGrid { get; set; }

    async Task OnGridRead(GridReadEventArgs args)
    {
        if (!ShouldBindGrid)
        {
            return;
        }

        await Task.Delay(200); // simulate network delay

        DataSourceResult result = GridData.ToDataSourceResult(args.Request);

        args.Data = result.Data;
        args.Total = result.Total;
        args.AggregateResults = result.AggregateResults;
    }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            // workaround for initial Grid aggregates
            ShouldBindGrid = true;
            GridRef.Rebind();
            StateHasChanged();
        }
    }

    protected override void OnInitialized()
    {
        GridData = new List<Product>();
        var rnd = new Random();

        for (int i = 1; i <= 50; i++)
        {
            GridData.Add(new Product()
            {
                Id = i,
                Name = "Product " + i.ToString(),
                Price = (decimal)rnd.Next(1, 100),
                ReleaseDate = DateTime.Now.AddDays(-rnd.Next(60, 1000)),
                Active = i % 3 == 0
            });
        }
    }

    public class Product
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }
        public DateTime ReleaseDate { get; set; }
        public bool Active { get; set; }
    }
}

Unplanned
Last Updated: 30 May 2023 09:57 by ADMIN

Currently, the empty cells in the exported Excel file contain zero-length strings. As a result, the ISBLANK() function returns false for them while the cells essentially do not have content.

Please allow the empty Grid cells to be treated as blank in the exported Excel file.

===

ADMIN EDIT

===

For the time being, you may extend the formula to also check whether the length of the cell content is 0. For that purpose, you may use the LEN() function as suggested here:  https://learn.microsoft.com/en-us/office/troubleshoot/excel/isblank-function-return-false#workaround.

Completed
Last Updated: 24 Feb 2023 20:55 by ADMIN
If I bind a GridColumn to a char, the Export throws an exception that Char cannot be converted to Double. 
Unplanned
Last Updated: 14 Feb 2023 10:55 by Tino

When I autofit all columns multiple times in a row, the Grid misbehaves and wraps longer column content in multiple lines. 

<AdminEdit>

As a workaround, set the MinResizableWidth parameter of the Grid columns that wrap their content.

</AdminEdit>

Unplanned
Last Updated: 27 Jun 2023 11:50 by ADMIN
Created by: Nate
Comments: 3
Category: Grid
Type: Feature Request
7

Similar to the WPF grid I would like the option to require the user hold shift to sort by multiple columns, otherwise the grid would sort by only a single column.

https://docs.telerik.com/devtools/wpf/controls/radgridview/sorting/multiple-column-sorting

Unplanned
Last Updated: 09 Feb 2023 11:57 by Meindert
Created by: Meindert
Comments: 0
Category: Grid
Type: Bug Report
1

Hello,

Imagine a Grid with in-cell editing and a cell X, which restricts editing via IsCancellable = true in the OnEdit event.

If the user clicks on cell X, then editing will be cancelled and the focus will be on this cell.

If the user tabs from the previous cell, then editing will be cancelled and the focus will be on the previous cell.

This looks like an inconsistency. Can the focus go to cell X when editing is cancelled from a tab?

Unplanned
Last Updated: 04 Sep 2023 08:44 by ADMIN

When the Virtualization feature is enabled, triggering Incell edit causes the Grid to scroll. When we scroll the edit is canceled. This happens when the row is partially visible.
https://www.screencast.com/t/zCJ9z9P83c

A more specific case is when you try to edit the last row. In case the editor height is bigger than the row height the Grid tries to scroll but there is no more data. The editor is closed and the item cannot be edited.
https://www.screencast.com/t/331cT4xxt

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

 

Duplicated
Last Updated: 30 Jun 2023 09:36 by ADMIN
Created by: Brent
Comments: 1
Category: Grid
Type: Feature Request
2

I'm trying to use the FilterMenu with the CheckBoxListFilter, and it seems like it's sooo close to what I want, if it only had an option for FieldText and FeildValue or something like that. Any way I can get this working to use the ID field as the value and the Name as the text? The highlighted section below is what I would envision it working perfectly as.

<GridColumn Field="@nameof(WorkActivity.WorkGroupId)" Title="Work Group" Width="135px">
            <FilterMenuTemplate Context="context">
                <TelerikCheckBoxListFilter Data="@WorkGroups"
                                           Field="@(nameof(WorkGroup.Name))" FieldValue="@(nameof(WorkGroup.Id))" 
                                           @bind-FilterDescriptor="@context.FilterDescriptor">
                </TelerikCheckBoxListFilter>
            </FilterMenuTemplate>
Unplanned
Last Updated: 07 Jan 2025 18:14 by Mohamad Javad
Created by: Simi
Comments: 4
Category: Grid
Type: Feature Request
33

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.