Completed
Last Updated: 05 Jul 2024 10:57 by EMMANUEL
Release 2.30.0
Created by: Danilo
Comments: 4
Category: Grid
Type: Feature Request
26

I have a grid with the excell Export. Now I have two custom Export buttons on the Page (Over and under the Grid).

Can I somehow trigger the Grid Excell Export command Manually? 

---

ADMIN EDIT

Here is a workaround - a bit of JS to click the desired button and the second snippet shows how to invoke it from a blazor component and code.

 <script>
        function clickButton(selector) {
            var btn = document.querySelector(selector);
            if (btn && btn.click) {
                btn.click();
            }
        }
    </script>

@inject IJSRuntime _js

<style>
    /* hide the built-in button if you like */
    .myExcelExportButton {
        display:none;
    }
</style>

<button @onclick="@MyExternalExportTrigger">my external export button</button>

<TelerikGrid Data="@GridData" Pageable="true" Sortable="true" Resizable="true" Reorderable="true"
             FilterMode="@GridFilterMode.FilterRow" Groupable="true"
             Class="@GridClass">
    <GridToolBar>
        <GridCommandButton Class="@ExportBtnClass" Command="ExcelExport" Icon="@IconName.FileExcel">Export to Excel</GridCommandButton>
        <label><TelerikCheckBox @bind-Value="@ExportAllPages" />Export All Pages</label>
    </GridToolBar>
    <GridExport>
        <GridExcelExport FileName="telerik-grid-export" AllPages="@ExportAllPages" />
    </GridExport>

    <GridColumns>
        <GridColumn Field="@nameof(SampleData.ProductId)" Title="ID" Width="100px" />
        <GridColumn Field="@nameof(SampleData.ProductName)" Title="Product Name" Width="300px" />
        <GridColumn Field="@nameof(SampleData.UnitsInStock)" Title="In stock" Width="100px" />
        <GridColumn Field="@nameof(SampleData.Price)" Title="Unit Price" Width="200px" />
        <GridColumn Field="@nameof(SampleData.Discontinued)" Title="Discontinued" Width="100px" />
        <GridColumn Field="@nameof(SampleData.FirstReleaseDate)" Title="Release Date" Width="300px" />
    </GridColumns>
</TelerikGrid>

@code {
    // cascade through classes on the grid and/or on the built-in button to click it with JS
    // so that it can invoke the built-in export operations
    string GridClass { get; set; } = "MyGrid";
    string ExportBtnClass { get; set; } = "myExcelExportButton";
    async Task MyExternalExportTrigger()
    {
        var selector = $".{GridClass} .k-header .{ExportBtnClass}";
        await _js.InvokeVoidAsync("clickButton", selector);
    }



    List<SampleData> GridData { get; set; }
    bool ExportAllPages { get; set; }

    protected override void OnInitialized()
    {
        GridData = Enumerable.Range(1, 100).Select(x => new SampleData
        {
            ProductId = x,
            ProductName = $"Product {x}",
            UnitsInStock = x * 2,
            Price = 3.14159m * x,
            Discontinued = x % 4 == 0,
            FirstReleaseDate = DateTime.Now.AddDays(-x)
        }).ToList();
    }

    public class SampleData
    {
        public int ProductId { get; set; }
        public string ProductName { get; set; }
        public int UnitsInStock { get; set; }
        public decimal Price { get; set; }
        public bool Discontinued { get; set; }
        public DateTime FirstReleaseDate { get; set; }
    }
}

---

Completed
Last Updated: 12 Jun 2024 11:29 by ADMIN
Release 2.18.0

Please add an attribute to Blazor GridColumn which allows to easily format data with the default .NET standard formats

e.g. <GridColumn Field="@(nameof(Item.Price))" Title="Price" Format="0#.##" />

It's a little bit annoying always having to define a template for this purpose.

 


Not Logged in

Completed
Last Updated: 28 May 2024 05:59 by ADMIN
Release 2023.2
Created by: Constantinos Petridis
Comments: 2
Category: Grid
Type: Bug Report
1

When you combine frozen column with row selection and horizontal scrolling is applied (due to column and grid widths), column content are not hidden under frozen columns when a row is selected, as seen bellow in lines 2,3 and 4.

Checkbox, Product Name & Command columns are frozen. "Quantity per Unit" values are clearly visible behind frozen "Product Name" values. You can find a test scenario here (Telerik REPL for Blazor).

All themes suffer from this issue except Fluent theme. With default and bootstrap themes it happens on all odd selected lines and with material theme it happens on all selected lines.

Completed
Last Updated: 17 May 2024 13:11 by ADMIN
Release 2024 Q2 (May)
Subject says it all.  Would like the ability to selectively enable/disable a single checkbox in a checkbox column.
Completed
Last Updated: 10 May 2024 10:04 by ADMIN
Release 5.0.0 (15 Nov 2023) (R1 PI1)

Grid headers are misaligned if they are navigated in a scrolling scenario with a Frozen column.

===

ADMIN EDIT

===

The behavior affects the TreeList as well in a similar fashion. The misalignment is bigger when there is a frozen column but it is also reproducible without it in this demo.

Completed
Last Updated: 25 Apr 2024 08:35 by ADMIN
Release 2024 Q2 (May)

The null type of operator can cause errors on the backend

*** Thread created by admin on customer behalf ***

Completed
Last Updated: 22 Apr 2024 07:47 by ADMIN
Release 2024 Q2 (May)

Hi Telerik team,

 

When I want to bind the Blazor Grid to an ExpandoObject I need to assign the FieldType. I know I have to use non-nullable types.

But I want to use nullable types (for example int?) to have a blank cell within the Grid when there is no value for it. With "typeof(int)" instead of "typeof(int?)" every empty cell shows "0" which I don't want.

Is there any chance to let FieldType accept nullable types?

 

Best regards,

Rayko

Completed
Last Updated: 12 Apr 2024 15:40 by ADMIN
Release 2024 Q2 (May)

There is a change in the Grid behavior from version 4.6.0 to 5.0.0.

Consider the following REPL test page: https://blazorrepl.telerik.com/cSabmRPy306iPiXK18

Clicking on a Grid cell for editing will not open it for editing if there is already an open cell in edit mode on the same table row. The issue is reproduced more easily if the OnUpdate handler is empty or not defined at all.

This used to work in version 4.6.0.

Completed
Last Updated: 01 Apr 2024 13:11 by ADMIN
Release 2024 Q2 (May)

I have a TelerikGrid with Reordarable enabled inside of a TelerikWindow. Reordering of the column works fine only the drop clue is not showing. I think this is because the z-index is incorrect.

Missing drop clue:

 

z-index of drop clue is 10000:

 

z-index of window is 10002:

Completed
Last Updated: 18 Mar 2024 09:58 by ADMIN

It seems that the issue appeared after upgrading to Telerik 5.0 from 4.6.

When using a Grid with a locked column and column virtualization enabled, focusing cell from that locked column breaks the layout on horizontal scrolling.

Completed
Last Updated: 13 Mar 2024 06:02 by ADMIN
Release 2024 Q2 (May)

Hello,

Do you have any sample for custom group Header template.

 

e..g. To  calculate the value of the column based on the other fields.

---

ADMIN EDIT

---

Once aggregates for all fields are exposed, we will need to provide an option to align them with the corresponding columns. This can be achieved through a GroupHeaderColumnTemplate which is targeted in a separate request.

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: 11 Mar 2024 09:39 by ADMIN
Release 2.30.0

In a Grid loaded with data made of ExpandoObject, set an aggregate GridAggregateType.Sum breaks the grouping feature while GridAggregateType Max, Min and Count work properly

Please find the attached project: in the grid on Index.razor grouping does not work, just comment Index.razor:43 to restore grouping feature


Exception message:

Error: System.InvalidOperationException: No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic. 
   at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)
   at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)
   at Telerik.DataSource.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateMethodCallExpression(LambdaExpression memberSelectorExpression)
   at Telerik.DataSource.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateAggregateExpression()
   at Telerik.DataSource.EnumerableSelectorAggregateFunction.CreateAggregateExpression(Expression enumerableExpression, Boolean liftMemberAccessToNull)
   at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.<ProjectionPropertyValueExpressions>b__39_0(AggregateFunction f)
   at System.Linq.Enumerable.SelectIListIterator`2.ToList()
   at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression()
   at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding()
   at Telerik.DataSource.Expressions.QueryableAggregatesExpressionBuilder.CreateMemberBindings()+MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)
   at System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
   at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression()
   at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression()
   at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery()
   at Telerik.DataSource.Extensions.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
   at Telerik.DataSource.Extensions.QueryableExtensions.CreateDataSourceResult[TModel,TResult](IQueryable queryable, DataSourceRequest request, Func`2 selector)
   at Telerik.DataSource.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request)
   at Telerik.DataSource.Extensions.QueryableExtensions.ToDataSourceResult(IEnumerable enumerable, DataSourceRequest request)
   at Telerik.Blazor.Data.TelerikDataSourceBase.ProcessData(IEnumerable data)
   at Telerik.Blazor.Components.Common.DataBoundComponent`1.ProcessDataInternal()
   at Telerik.Blazor.Components.Common.DataBoundComponent`1.ProcessDataAsync()
   at Telerik.Blazor.Components.TelerikGrid`1.DataBoundProcessData()
   at Telerik.Blazor.Components.TelerikGrid`1.ProcessDataAsync()
   at Telerik.Blazor.Components.TelerikGrid`1.ApplyFiltersAsync()
   at Telerik.Blazor.Components.TelerikGrid`1.OnFilterChange(FilterDescriptorBase filter)
   at Telerik.Blazor.Components.Common.Filters.TelerikFilterHeader`1.Filter(FilterDescriptor filterDescriptor)
   at Telerik.Blazor.Components.Common.Filters.TelerikFilterHeader`1.OnValueChanged(Object newValue)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

 

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
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: 30 Jan 2024 13:48 by ADMIN
Release 2024 Q1 (Jan)

The filter list item menu defined as follows do not have accessible name.  Please provide work around or fix that I can implement.

                            <TelerikGrid Data="@ViewModel.RouterAndDataLossInformation" TItem="TrafficLossSummary"
                                                        Pageable="true" 
                                                        Sortable="true" 
                                                        Groupable="false"
                                                        FilterMode="Telerik.Blazor.GridFilterMode.FilterRow"
                                                        Resizable="true" 
                                                        Reorderable="true"
                                                        Height = "100%">

Completed
Last Updated: 18 Jan 2024 09:10 by ADMIN
Created by: Aditya
Comments: 13
Category: Grid
Type: Feature Request
45

I want to be able to enter numbers and the grid to filter numeric fields too according to those numbers. Enums would be nice too.

 

**Admin Edit**

The feature request will be researched and evaluated. It contradicts to our datasource filtering logic that relies on the type of the fields. Thus, it is highly possible that we will handle the task through a knowledge base example.

**Admin Edit**

 

Completed
Last Updated: 17 Jan 2024 14:23 by ADMIN
Release 5.1.0 (31 Jan 2024) (R1 2024)
Created by: Jim
Comments: 6
Category: Grid
Type: Feature Request
28

The request targets a hierarchical Grid where some items are expanded - when I edit a parent item and then update it, all the respective detail items collapse.

Please add support for persisting the expanded state of the items.

---

ADMIN EDIT

---

The feature applies to the other data operations as well (for example, paging, sorting, filtering etc.).

Completed
Last Updated: 12 Jan 2024 14:00 by Ben
Release 5.1.0 (31 Jan 2024) (R1 2024)
When using a Grid with a multi-column header which is locked, the layout breaks on horizontal scrolling. This behavior appears since Telerik UI Version 4.6 and also remains in 5.0.0 and 5.0.1.

See REPL sample (just use horizontal scroll): https://blazorrepl.telerik.com/wRPvclYX432myApT30.

When switching to Version 4.5 the Grid acts as expected.
Completed
Last Updated: 11 Jan 2024 14:04 by ADMIN
Release 3.0.0

https://docs.telerik.com/blazor-ui/components/grid/editing/incell#notes 

I am using an EditorTemplate with a method called ChangeHandler(). After clicking in another row everything works fine but if I leave the cell by pressing enter the UpdateHandler gets called more than two times and comparing args.Item with the GridItem doesn't help because the calls are asynchronous.

=====

Admin Edit

With 2.22.0, the InCell editing mode was revamped to provide better user experience and this alters the way it worked. In the common case, there will no longer be double OnUpdate calls (unless explicit application logic invokes them). With 2.23.0, Tab and Enter keys that bubble from editor templates will be handled by the grid like they are handled for the built-in editors.

This means that this issue is, effectively, solved. You can see the Notes section about editor templates to see how you can also handle the OnBlur event to capture mouse clicks outside of the component so that you can save changes and remove the edited item. See the full notes here (the Event Sequence section was heavily revamped for clarity) and here on editor template behavior.

Thus, the previous ides about  Save and Cancel methods on the edit context might not be implemented, which will also be one breaking change that we could avoid:

After discussion with the development team, the proposed resolution is to provide a context that provides Save/Cancel operations. The goal is to provide easier configuration for IncellEditing and EditorTemplates and consistent behavior with mouse and keyboard interaction. However, the change will introduce a breaking change in our EditorTemplate, should be researched further and that is why this is logged as a feature request.

=====