Completed
Last Updated: 23 Apr 2020 10:29 by ADMIN
Release 2.13.0

Reproducible:

 

@using System.Collections.ObjectModel;

<div style="align-self:center;text-align:center" class="alert-danger">
    @errorMessages
</div>
<div style="align-self:center;text-align:center" class="alert-success">
    @successMessages
</div>
<TelerikGrid Data=@entitlementsExtended
             Pageable="true"
             Groupable="false"
             PageSize="@PageSize"
             OnUpdate="@UpdateHandler"
             Sortable="false"
             FilterMode="Telerik.Blazor.GridFilterMode.FilterMenu">
    <GridColumns>
        <GridColumn Field="@nameof(EntitlementValueDTOExtended.Description)" Editable="false" />
        <GridColumn Field=@nameof(EntitlementValueDTOExtended.Value)>
            <EditorTemplate>
                @{
                    CurrentlyEditedEntitlement = context as EntitlementValueDTOExtended;
                    <div>
                        <TelerikDropDownList Data="@entitlementOptions" @bind-Value="CurrentlyEditedEntitlement.Value" Width="60px" PopupHeight="auto"></TelerikDropDownList>
                    </div>
                }
            </EditorTemplate>
        </GridColumn>

        <GridCommandColumn Width="300px">
            <GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
            <GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
            <GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">Cancel</GridCommandButton>
        </GridCommandColumn>
    </GridColumns>
</TelerikGrid>

@code {
    int PageSize = 10;
    public EntitlementValueDTOExtended CurrentlyEditedEntitlement { get; set; } = new EntitlementValueDTOExtended();

        //changing this to List<> works
    public ObservableCollection<EntitlementValueDTOExtended> entitlementsExtended { get; set; } = new ObservableCollection<EntitlementValueDTOExtended>();

    public static List<string> entitlementOptions = new List<string> { "I", "E" };

    public string errorMessages { get; set; } = "";
    public string successMessages { get; set; } = "";

    protected async override Task OnInitializedAsync()
    {
        IEnumerable<int> entitlements = Enumerable.Range(1, 50);

        //this is a simplified workaround for people needing nested models
        foreach (var entitlement in entitlements)
        {
            EntitlementValueDTOExtended entitlementExtended = new EntitlementValueDTOExtended();
            entitlementExtended.Id = Guid.NewGuid();
            entitlementExtended.Description = $"descr {entitlement}";
            entitlementExtended.Value = $"value {entitlement}";
            entitlementExtended.EntitlementTypeId = entitlement;

            entitlementsExtended.Add(entitlementExtended);
        }
        StateHasChanged();

        await base.OnInitializedAsync();
    }

    public async Task UpdateHandler(GridCommandEventArgs args)
    {
        EntitlementValueDTOExtended item = (EntitlementValueDTOExtended)args.Item;

        var matchingItem = entitlementsExtended.FirstOrDefault(c => c.Id == item.Id);
        if (matchingItem != null)
        {
            matchingItem.Description = item.Description;
            matchingItem.EntitlementTypeId = item.EntitlementTypeId;
            matchingItem.Value = item.Value;
        }

        successMessages = $"updated grid on {DateTime.Now}";
        StateHasChanged();

    }

    public class EntitlementValueDTOExtended
    {
        public Guid Id { get; set; }
        public string Description { get; set; } = "";
        public string Value { get; set; } = "";
        public int EntitlementTypeId { get; set; } = 0;
    }

Completed
Last Updated: 28 Jun 2024 09:01 by ADMIN
Release 2024 Q3 (Aug)
When you have a Navigable Grid with a Material theme, the sorting on each click does not work. You have to click outside of the header and click again in it to sort. The behavior can be seen only in version 6.0.0.
Completed
Last Updated: 22 Aug 2023 09:10 by ADMIN
Release 4.5.0 (08/30/2023) (R3 PI2)

By the following steps, the problem occurs:

  1. Click on line number 1 to focus the row
  2. Press the Down-Key 19 times to navigate to line 20
  3. Try to navigate to line 21 via the Down-Key
  4. -> No navigation possible via keyboard to the lines below
  5. Try to navigate backwards via Up-Key to line 1
  6. -> Navigation stops at line 15


So, it not possible to navigate through the whole grid with virtualized rows when Navigable=true





@* Scroll the grid instead of paging *@

<TelerikGrid Data=@GridData
             ScrollMode="@GridScrollMode.Virtual" Navigable="true"
             Height="480px" RowHeight="60" PageSize="20"
             Sortable="true" FilterMode="@GridFilterMode.FilterMenu">
    <GridColumns>
        <GridColumn Field="Id" />
        <GridColumn Field="Name" Title="First Name" />
        <GridColumn Field="LastName" Title="Last Name" />
        <GridColumn Field="HireData" Width="200px">
            <Template>
                @((context as SampleData).HireDate.ToString("MMMM dd, yyyy"))
            </Template>
        </GridColumn>
    </GridColumns>
</TelerikGrid>

@code {
    public List<SampleData> GridData { get; set; }

    protected override async Task OnInitializedAsync()
    {
        GridData = await GetData();
    }

    private async Task<List<SampleData>> GetData()
    {
        return Enumerable.Range(1, 1000).Select(x => new SampleData
        {
            Id = x,
            Name = $"name {x}",
            LastName = $"Surname {x}",
            HireDate = DateTime.Now.Date.AddDays(-x)
        }).ToList();
    }

    public class SampleData
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string LastName { get; set; }
        public DateTime HireDate { get; set; }
    }
}

  
Completed
Last Updated: 24 Sep 2020 09:44 by ADMIN
Release 2.18.0

Reproducible:

 

1. Run the snippet below
2. click the grid
3. press Down until you reach the last row, then press Down again

 

<TelerikGrid Navigable="true" Pageable="false"
             Data=@GridData Height="400px" >
    <GridColumns>
        <GridColumn Field=@nameof(Employee.Name) />
        <GridColumn Field=@nameof(Employee.Team) Title="Team" />
    </GridColumns>
</TelerikGrid>

@code {
    public List<Employee> GridData { get; set; }

    protected override void OnInitialized()
    {
        GridData = new List<Employee>();
        for (int i = 0; i < 15; i++)
        {
            GridData.Add(new Employee()
            {
                EmployeeId = i,
                Name = "Employee " + i.ToString(),
                Team = "Team " + i % 3
            });
        }
    }

    public class Employee
    {
        public int EmployeeId { get; set; }
        public string Name { get; set; }
        public string Team { get; set; }
    }
}
Completed
Last Updated: 10 Jan 2023 12:13 by ADMIN
Release 4.0.0 (18 Jan 2023) (R1 2023)

The Custom Filter Menu in the Grid is not working as I would expect.

 

I am trying to do two things

  1. Apply filters programmatically through the Grid State
  2. Populate a custom Filter Menu with values that exist in that column

I am doing something very similar to the demo for the custom filter menu: https://demos.telerik.com/blazor-ui/grid/custom-filter-menu

I have observed that if I set a filter programatically through the grid state, those filters are applied to the grid but are not being passed through the FilterMenuTemplateContext object in the FilterMenuTemplate when I open the Filter Menu for that column.  Therefore, I cannot update my custom filter to show which values are currently being filtered on.

Is it by design that the FilterMenuTemplateContext does not contain Filters applied through the grid state or a bug?

---

ADMIN EDIT

As of Dec 2020, there is one outstanding issue - using complex filters (having a CompositeFilterDescriptor) for the FilterRow filter template gets saved in the grid state, but is not loaded as expected - the filter row uses a "regular" FilterDescriptor and cuts off additional descriptors. Thus, the context of the template does not provide all the data from the grid state and you need to extract it manually. I have attached a sample that shows one way of doing that in the StateInit handler.

The FilterMenu already provides all the data in its context and you can bind inputs in the template directly to the filter descriptors. Once the filter row can work with more complex filter descriptors as well, you would be able to create the extra descriptors (if they are not already there) and directly bind the inputs to their value, as opposed to the current approach where view-model fields are used.

---

Completed
Last Updated: 12 Mar 2024 09:26 by ADMIN
Release 2024 Q2 (May)

---

ADMIN EDIT

Attached to this post are a reproducible and a workaround - setting the state in OnAfterRenderAsync with a small delay, so the initial grid render happens, then it can re-render and take the filters into account.

---

Completed
Last Updated: 16 Jan 2020 09:32 by ADMIN
Release 2.6.1
Created by: Nick
Comments: 8
Category: Grid
Type: Bug Report
8

Hi,

I've noticed some odd behaviour where the OnRead event is being called twice. Initially I thought it was my code, but I've got to a bizarre example where having two Console.WriteLine statements causes the repeated call, but having one doesn't!

In my testing with more code in the method it hasn't been consistent, so I'm not sure if it's a timing/threading issue. I have tested with the following:

  • Browser: Firefox and Chrome
  • VS: 16.4 Preview 5.
  • .Net Core: 3.1 Preview 2
  • Telerik: 2.3

My test code looks like this:

 

@layout EmptyLayout
@page "/testgrid"
<TelerikGrid Data=@GridData TotalCount=@Total
             Pageable=true PageSize=15
             OnRead=@ReadItems>
    <GridColumns>
        <GridColumn Field=@nameof(Employee.Id) Title="ID" />
        <GridColumn Field=@nameof(Employee.Name) Title="Name" />
    </GridColumns>
</TelerikGrid>
 
@code {
    public List<Employee> GridData { get; set; }
    public int Total { get; set; } = 0;
 
    protected async Task ReadItems(GridReadEventArgs args)
    {
        Console.WriteLine("ReadItems 1");
        // Remove this line and ReadItems is only called once!!!
        Console.WriteLine("ReadItems 2");
 
        // Adding this makes no difference
        //await Task.Delay(1);
    }
 
    public class DataEnvelope
    {
        public List<Employee> CurrentPageData { get; set; }
        public int TotalItemCount { get; set; }
    }
 
    public class Employee
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}

 

Any help appreciated!
Thanks.

 

Completed
Last Updated: 27 Apr 2022 13:04 by ADMIN
Release 3.3.0
I am using a bool property to control whether the rows of the Grid would be draggable. When I try to toggle the value of this property the feature is not enabled or disabled accordingly. 
Completed
Last Updated: 09 Sep 2020 08:28 by ADMIN
Release 2.17.0

The issue can be reproduced using the Filter From Code -> FilterMenu code snippet provided here:
https://docs.telerik.com/blazor-ui/components/grid/filtering#filter-from-code

 

Completed
Last Updated: 19 Oct 2021 08:16 by ADMIN
Release 2.28.0
Created by: Oliver
Comments: 0
Category: Grid
Type: Bug Report
8

When I switch the culture of my App from English to Swedish, the Virtual scrolling feature of the Grid breaks. 

===========

ADMIN EDIT

===========

The issue stems from invalid transform style applied to the k-virtual-position div element in Swedish culture. Due to integer to string conversion that takes culture into consideration when setting the style and/or data-translate attribute, when this number is < 0, the negative sign is longer dash for Swedish culture. This longer dash is not parsable by JS and CSS which is why the translateY transform is invalid.

As a workaround for the time being, you can try adding transform style for the k-virtual-position div, so you can override the default one and the correct dash will be applied: 

<style>
    .k-virtual-position {
        transform: translateY(-1080px);
    }
</style>

 

 

 

Completed
Last Updated: 08 Jul 2020 09:23 by ADMIN
Release 2.16.0
Created by: Maurice
Comments: 1
Category: Grid
Type: Bug Report
8
At the moment I get an empty grid when I group
Completed
Last Updated: 14 Jan 2022 12:00 by ADMIN
Release 3.0.0

Here is the scenario:

  • UI for Blazor version 2.30
  • Grid with InCell editing
  • EditorTemplate with a DropDownList inside

In version 2.30 there is no longer need for an explicit blur handler for the in-cell editor template. The editor template closes automatically when the user selects a value from the DropDownList. However, the new value is ignored.

REPL test page: https://blazorrepl.telerik.com/mFbcmQvs16Lf1jwv18

Completed
Last Updated: 24 Nov 2021 12:40 by ADMIN

I am using EF on my backend and when I group I get an error like this one:

Unhandled exception rendering component: Processing of the LINQ expression '(GroupByShaperExpression:
      KeySelector: (t.FirstName), 
      ElementSelector:(EntityShaperExpression: 
          EntityType: Customer
          ValueBufferExpression: 
              (ProjectionBindingExpression: EmptyProjectionMember)
          IsNullable: False
      )
      )' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
System.InvalidOperationException: Processing of the LINQ expression '(GroupByShaperExpression:
KeySelector: (t.FirstName), 
ElementSelector:(EntityShaperExpression: 
    EntityType: Customer
    ValueBufferExpression: 
        (ProjectionBindingExpression: EmptyProjectionMember)
    IsNullable: False
)
)' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
   at Microsoft.EntityFrameworkCore.Query.Internal.RelationalProjectionBindingExpressionVisitor.VisitExtension(Expression extensionExpression)
   at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)

 

and a lot more line through the EF Core expression classes.

-----

ADMIN EDIT

At the moment, it looks like there is an issue between EF, LINQ and GroupBy expressions that seems to be the origin of this. In a profiler, you can see that running a group expression does not even run a query against the database itself - this is the origin of the problem, and the subsequent paging operation is where an actual exception is thrown, but it points to the field that was used for grouping.

Considering that grouping has to pull all the data anyway, materializing the data from an IQueriable to an IEnumerable should solve the issue, even though it can be a performance hit - for relatively small data sets it may not be a significant problem.

    protected override void OnInitialized()
    {
        GridData = ProductService.GetProducts().ToList();
    }

 

----

Completed
Last Updated: 01 Dec 2020 16:04 by ADMIN
Release 2.19.0

On initialization of the Grid the oDataString is correct, but when I apply a Filter (through the FilterMenu) or apply a sort to a Grid column the ToODataString extension method throws with null reference exception. If the FilterMode is set to FilterRow or revert back to 2.16.0 everything works as expected. 

<AdminEdit>

This bug extends to the functionality of the FilterMenu as a feature and is not connected only to the ToODataString();

</AdminEdit>

Completed
Last Updated: 15 Aug 2023 14:10 by ADMIN
Release 4.5.0 (08/30/2023) (R3 PI2)

When the Grid has a non-grouped column at first position, there is a missing left border in an adjacent cell on the second line of the header area.

First reported in:

https://www.telerik.com/forums/multi-column-line-in-grid-occasionally-missing

Possible workarounds:

  • Move the non-grouped column to another position.
  • Wrap the non-grouped column in its own group.

Test page to reproduce:

(Uncomment the group column to use the second workaround from above.)

<TelerikGrid Data="@Data">
    <GridColumns>
        @*<GridColumn Title="Title">
        <Columns>*@
            <GridColumn Field="ID" />
        @*</Columns>
        </GridColumn>*@
        <GridColumn Title="Group">
            <Columns>
                <GridColumn Field="Name" />
            </Columns>
        </GridColumn>
    </GridColumns>
</TelerikGrid>

@code {

    public List<GridItem> Data { get; set; } = new List<GridItem>() {
        new GridItem() { ID = 1, Name = "Name 1" }
    };

    public class GridItem
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }
}

 

Completed
Last Updated: 17 Jan 2022 18:59 by ADMIN
Release 3.0.0

Grid virtual scrolling will freeze in the following scenario:

  1. Open https://demos.telerik.com/blazor-ui/grid/virtual-scrolling
  2. Scroll to the lower part of the Grid
  3. Filter any column, so that the number of items becomes less than the current scroll position
  4. The Grid will show "no records to display" and row placeholders, even if there are items to display

 

Completed
Last Updated: 09 Aug 2022 07:44 by ADMIN
Release 3.6.0 (14 Sep 2022) (R3 2022)
Field and Value properties from GridCommandEventArgs don't populate in Incell editing. Their value is always null and thus I cannot get information for the edited field.
Completed
Last Updated: 22 Feb 2024 13:31 by ADMIN
Release 2024 Q2 (May)
Created by: David
Comments: 0
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; }
    }
}

Completed
Last Updated: 19 Feb 2020 11:12 by ADMIN
Release 2.8.0
Created by: Robert
Comments: 3
Category: Grid
Type: Bug Report
7

I have a simple Grid with custom detail template

    <Telerik.Blazor.Components.TelerikGrid Data="@GridData" FilterMode="Telerik.Blazor.GridFilterMode.FilterRow" >

        <GridColumns>
            <Telerik.Blazor.Components.GridCheckboxColumn Title="Selected"></Telerik.Blazor.Components.GridCheckboxColumn>
            <Telerik.Blazor.Components.GridColumn Title="Name" Filterable="true" Field="@nameof(GridItem.Text)"></Telerik.Blazor.Components.GridColumn>
            <Telerik.Blazor.Components.GridColumn Field="@nameof(GridItem.Date)" Filterable="true" Title="Date"></Telerik.Blazor.Components.GridColumn>
            <Telerik.Blazor.Components.GridColumn Field="@nameof(GridItem.Id)" Filterable="true" Title="Id"></Telerik.Blazor.Components.GridColumn>
            <Telerik.Blazor.Components.GridColumn Field="@nameof(GridItem.ParentIdValue)" Filterable="true" Title="Parent Id"></Telerik.Blazor.Components.GridColumn>
            <Telerik.Blazor.Components.GridColumn Field="@nameof(GridItem.HasChildren)" Filterable="true" Title="Has Children"></Telerik.Blazor.Components.GridColumn>
        </GridColumns>

        <DetailTemplate>
            <div>Custom Template</div>
        </DetailTemplate>

    </Telerik.Blazor.Components.TelerikGrid>

 

And here is what it looks like. Filters are moved one column to the left. When I remove DetailTemplate everything is ok.

 

Completed
Last Updated: 11 Oct 2019 12:22 by ADMIN
Release 2.2.0
Created by: Andrew
Comments: 1
Category: Grid
Type: Bug Report
7

Hello,

I want to have the TelerikGrid's "Add" command display a popup for the new record's details, in the same way that the "Edit" functionality does. However with:

        <TelerikGrid EditMode="popup">
            <TelerikGridToolBar>
                <TelerikGridCommandButton Command="Add" Icon="add">Add</TelerikGridCommandButton>

When I click "Add", the new blank row is shown within the grid identical to EditMode="inline", not as a popup. Is the "Add" functionality meant to work in popup mode?