Unplanned
Last Updated: 14 Jun 2021 12:27 by ADMIN
Created by: Michael
Comments: 0
Category: Grid
Type: Feature Request
3

We often have grid data with a widely varying quantity of cell content from row to row. We usually present this with constant row height initially to have as much row overview as possible at a glance.

Grabbing the row divider line and individually make it larger or even double click on it to fit the size would be very useful for users.

Completed
Last Updated: 03 Aug 2021 13:40 by ADMIN
Release 2.26.0

Hi,


I am getting an unhandled exception when setting the GridState of a TelerikGrid with the SetState method that has multi-column headers.


Exception:

Unhandled exception rendering component: More than one sibling of element 'col' has the same key value, 'Telerik.Blazor.Components.GridColumn'. Key values must be unique.

Example grid:

<TelerikGrid @ref=@TestGrid Data=@TestData FilterMode=GridFilterMode.FilterMenu Sortable="true" SortMode=SortMode.Multiple TItem="TestDataItem">
   <GridColumns>
       <GridColumn Title="Test Column 1" Field=@nameof(TestDataItem.TestColumn1) />
       <GridColumn Title="Test Column Group" />
          <Columns>
             <GridColumn Title="Test Column 2" Field=@nameof(TestDataItem.TestColumn2) />
             <GridColumn Title="Test Column 3" Field=@nameof(TestDataItem.TestColumn3) />
          </Columns>
       </GridColumn>
   </GridColumns>
<TelerikGrid>

 

I have tried to set the Id or @key of the columns but nothing has fixed this issue. 


Any help you can provide regarding this is appreciated.

Regards 
Completed
Last Updated: 12 Jan 2022 14:32 by ADMIN
Release 3.0.0
Created by: tilt32
Comments: 0
Category: Grid
Type: Bug Report
3

The TelerikGrid is kind of missing a "None" Value in the enum for the EditMode.

We need to disable the edit mode based on a value from the model (role access restricted), and I don't see any way this is possible without copy-pasting the entire grid under an if statement.

 

------ADMIN EDIT-------

A possible workaround at the moment is to set the "Editable" parameter of the columns to "false" or not use a command column with "edit".

Another workaround can be to attach a OnEdit handler and cancel the event based on the view model flag only. If the user cannot edit - always cancel.

Completed
Last Updated: 04 Aug 2021 17:02 by ADMIN
Created by: Matthias
Comments: 2
Category: Grid
Type: Bug Report
3

After the update I get the following error message:

/...Views/ViewRoute.razor(13,13): Error CS0012: The type 'SortDescriptor'is defined in an assembly that isnot referenced. You must add a reference to assembly 'Telerik.DataSource, Version=2.0.10.0, Culture=neutral, PublicKeyToken=29ac1a93ec063d92'. (CS0012)

the package is installed...nevertheless I get the error

<PackageReference Include="Telerik.UI.for.Blazor" Version="2.26.0" /> <PackageReference Include="Telerik.DataSource" Version="2.0.10" />

 

at this position
  GridState<Wegpunkte> desiredState = new GridState<Wegpunkte>()
        {
            SortDescriptors = new List<SortDescriptor>()
        {
                new SortDescriptor {Member = "TourPos", SortDirection = ListSortDirection.Ascending}
            }
        };
 
Unplanned
Last Updated: 16 Aug 2021 16:00 by ADMIN
Created by: Frank
Comments: 0
Category: Grid
Type: Feature Request
3
If a Grid column is bound to a nullable bool field and some of the data source records have null values for that field, you cannot filter the Grid by these values. The only available options for filtering bool? field are true and false (no null).
Unplanned
Last Updated: 09 Sep 2021 07:44 by ADMIN
I would like to recommend that a check box be added to the GridColumnMenuChooserGroup, so the entire group can be selected or deselected.  
Duplicated
Last Updated: 12 May 2022 17:03 by ADMIN
Created by: Jimmy
Comments: 1
Category: Grid
Type: Bug Report
3
Groups with load on demand cannot be deserialized properly and throw NullReferenceException
Completed
Last Updated: 03 Dec 2021 14:32 by ADMIN
Release 2.30.0
Created by: Radko
Comments: 0
Category: Grid
Type: Feature Request
3
I would like to be able to set constraints for min and max width for the draggable resizing introduced by the Resizable parameter of the Column. Meaning, if I set a min width of 50 pixels, I would like for the column to not be able to shrink beyond this point when manually resized by the draggable handle.
Unplanned
Last Updated: 28 Dec 2021 15:37 by Nemo
Created by: Nemo
Comments: 11
Category: Grid
Type: Feature Request
3

Hi, please expose the debounce delay as a property of TelerikGrid so we can set how soon virtualized columns are loaded after the user scrolls.

**Admin Edit**

This feature request requires research, and if such DebounceDelay parameter can work with good quality in all cases - it will be implemented. Additionally, we will revise the feature together with loading next set of columns if it will be applicable.

**Admin Edit**

Duplicated
Last Updated: 26 Apr 2022 10:51 by ADMIN
I have a record with id 1. In the OnEdit event, we check if the Edited item has Id == 1 and if so we cancel the edit. Now, the UI, if the Grid is in Read mode (not in Edit) clicking on the Grid cell that has Id == 1 does not trigger the edit, thus the editor is not rendered. On the other hand, if we open a previous cell that is editable and we click enter (tab) multiple times the non-editable cell will enter Edit mode and the editor is rendered.
Unplanned
Last Updated: 19 Sep 2024 08:06 by ADMIN
Loading Groups on Demand in a column with a nullable data type groups all records under the "Null" group
Unplanned
Last Updated: 03 Dec 2021 10:40 by ADMIN
Selected items are not preserved when loading the state when the component is bound to ExpandoObjects
Completed
Last Updated: 11 Jan 2022 20:43 by ADMIN
Release 3.0.0

I have a filterable DropDownList in a Grid EditorTemplate. The edit mode is InCell.

When the user opens the dropdown, the edited cell closes immediately with an OnUpdate call. The DropDownList value can be changed only with the keyboard or if I disable DropDownList filtering.

===

The same problem occurs with any component that uses a popup and the popup can gain focus - ComboBox, ColorPicker, etc.

Unplanned
Last Updated: 16 Mar 2022 10:31 by ADMIN

When you type something in the grid searchbox, there will be a X at the end to clear the box.

However, if you restore the grid from previously stored state like localstorage, and if the box has value, the X is not there.

Thanks!

Completed
Last Updated: 26 May 2022 18:19 by ADMIN
Release 3.4.0

The exception is -

System.ArgumentNullException: Value cannot be null. (Parameter 'source')

Here is a test page, based on this one -

@using Telerik.DataSource
@using Telerik.DataSource.Extensions
@using System.IO

<TelerikGrid TItem="@object"
             LoadGroupsOnDemand="true"
             Groupable="true"
             OnStateInit="@((GridStateEventArgs<object> args) => OnStateInitHandler(args))"
             OnRead="@ReadItems"
             ScrollMode="@GridScrollMode.Virtual" PageSize="20" RowHeight="60"
             Navigable="true" Sortable="true" FilterMode="@GridFilterMode.FilterRow" Height="600px">
    <GridColumns>
        <GridColumn Field="@nameof(Employee.Name)" FieldType="@typeof(string)" Groupable="false" />
        <GridColumn Field="@nameof(Employee.Team)" FieldType="@typeof(string)" Title="Team" />
        <GridColumn Field="@nameof(Employee.Salary)" FieldType="@typeof(decimal)" Groupable="false" />
        <GridColumn Field="@nameof(Employee.IsOnLeave)" FieldType="@typeof(bool)" Title="On Vacation" />
    </GridColumns>
</TelerikGrid>

@code {
    List<object> GridData { get; set; }

    protected async Task ReadItems(GridReadEventArgs args)
    {
        DataEnvelope<Employee> result = await MyService.GetData(args.Request);

        if (args.Request.Groups.Count > 0)
        {
            args.Data = result.GroupedData.Cast<AggregateFunctionsGroup>().ToList();
        }
        else
        {
            args.Data = result.CurrentPageData.Cast<Employee>().ToList();
        }

        args.Total = result.TotalItemCount;

        if (args.Request.Groups.Count > 0)
        {
            try
            {
                List<AggregateFunctionsGroup> items = result.GroupedData.Cast<AggregateFunctionsGroup>().ToList();

                await using var s = new MemoryStream();
                await System.Text.Json.JsonSerializer.SerializeAsync(s, items);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
    }

    void OnStateInitHandler(GridStateEventArgs<object> args)
    {
        // set initial grouping
        GridState<object> desiredState = new GridState<object>()
        {
            GroupDescriptors = new List<GroupDescriptor>()
    {
                new GroupDescriptor()
                {
                    Member = "Team",
                    MemberType = typeof(string)
                },
                new GroupDescriptor()
                {
                    Member = "IsOnLeave",
                    MemberType = typeof(bool)
                }
            }
        };

        args.GridState = desiredState;
    }

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

    public class DataEnvelope<T>
    {
        public List<AggregateFunctionsGroup> GroupedData { get; set; }
        public List<T> CurrentPageData { get; set; }
        public int TotalItemCount { get; set; }
    }

    public static class MyService
    {
        private static List<Employee> SourceData { get; set; }
        public static async Task<DataEnvelope<Employee>> GetData(DataSourceRequest request)
        {
            if (SourceData == null)
            {
                SourceData = new List<Employee>();
                var rand = new Random();
                for (int i = 1; i <= 2500; i++)
                {
                    SourceData.Add(new Employee()
                    {
                        EmployeeId = i,
                        Name = "Employee " + i.ToString(),
                        Team = "Team " + i % 100,
                        IsOnLeave = i % 3 == 0,
                        Salary = rand.Next(1000, 5000)
                    });
                }
            }

            await Task.Delay(500);// deliberate delay to showcase async operations, remove in a real app

            // retrieve data as needed, you can find more examples and runnable projects here
            // https://github.com/telerik/blazor-ui/tree/master/grid/datasourcerequest-on-server
            var datasourceResult = SourceData.ToDataSourceResult(request);

            DataEnvelope<Employee> dataToReturn;

            if (request.Groups.Count > 0)
            {
                dataToReturn = new DataEnvelope<Employee>
                {
                    GroupedData = datasourceResult.Data.Cast<AggregateFunctionsGroup>().ToList(),
                    TotalItemCount = datasourceResult.Total
                };
            }
            else
            {
                dataToReturn = new DataEnvelope<Employee>
                {
                    CurrentPageData = datasourceResult.Data.Cast<Employee>().ToList(),
                    TotalItemCount = datasourceResult.Total
                };
            }

            return await Task.FromResult(dataToReturn);
        }
    }
}

Declined
Last Updated: 25 Sep 2024 11:24 by ADMIN

   So what I propose is a fixed width for a column of the grid (and locked) with the remaining columns auto-sizing.

In my situation, I have an action switch button where the client can delete a row, edit a row etc but the action code dropdown column needs to ALWAYS be the same width.  The rest of the columns should automatically size based on the existing behaviour.

   Now I have tried using the autosize for just that column, but I have to render the grid first, then run the autosize (which gives a fun show of resizing to the user) then all the columns become fixed width, but the vertical scroll bar doesn't move and stays in its initial position.

 

 

Unplanned
Last Updated: 14 Aug 2023 08:23 by ADMIN
Created by: Hendrik
Comments: 0
Category: Grid
Type: Feature Request
3
Please allow the Grid to support in cell editing only via double click. This will give the possibility to preserve single clicks for selection.
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%">

Unplanned
Last Updated: 21 Oct 2022 13:13 by ADMIN
Created by: Peter
Comments: 2
Category: Grid
Type: Feature Request
3

The `Context` of `<GridColumn>` is of type `object`, requiring typecasting in order to use the value.

Instead, make `<GridColumn>` generic so that `Context` is strongly typed.  If you use `TItem` as the name for the generic then Blazor will infer it without the user having to specify it.

 

Unplanned
Last Updated: 25 Nov 2022 10:41 by Marc

I AutoFit all columns in the Grid but would like to be able to reset their width to the initial value at a later point. 

===

TELERIK EDIT: Here are two workarounds for two possible scenarios:

  • Reset all column widths to another value or "auto" value.
  • Adjust the last column's width, so that there is no empty space after it.

Reset all column widths to another value or "auto" value

<TelerikButton ThemeColor="@ThemeConstants.Button.ThemeColor.Primary"
               OnClick="@AutoFitColumns">AutoFit Columns</TelerikButton>
<TelerikButton ThemeColor="@ThemeConstants.Button.ThemeColor.Success"
               OnClick="@ResetColumns">Reset Column Widths</TelerikButton>

<TelerikGrid @ref="@GridRef"
             Data="@GridData"
             Reorderable="true"
             Resizable="true">
    <GridColumns>
        <GridColumn Field="@nameof(Product.Id)" />
        <GridColumn Field="@nameof(Product.Name)" />
        <GridColumn Field="@nameof(Product.Category)" />
        <GridColumn Field="@nameof(Product.Stock)" />
        <GridColumn Field="@nameof(Product.Discontinued)" />
    </GridColumns>
</TelerikGrid>

@code {
    private TelerikGrid<Product>? GridRef { get; set; }

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

    private async Task AutoFitColumns()
    {
        if (GridRef == null)
        {
            return;
        }

        await GridRef.AutoFitAllColumnsAsync();
    }

    private async Task ResetColumns()
    {
        if (GridRef == null)
        {
            return;
        }

        var gridState = GridRef.GetState();

        foreach (var columnState in gridState.ColumnStates)
        {
            columnState.Width = "auto;";
        }

        gridState.TableWidth = $"99.9{DateTime.Now.Millisecond}%"; // Set something close to 100% instead of removing the value

        await GridRef.SetStateAsync(gridState);
    }

    protected override void OnInitialized()
    {
        for (int i = 1; i <= 5; i++)
        {
            GridData.Add(new Product()
            {
                Id = i,
                Name = $"Product {i}",
                Category = $"Category {i % 4 + 1}",
                Stock = Random.Shared.Next(0, 100),
                Discontinued = i % 3 == 0
            });
        }
    }

    public class Product
    {
        public int Id { get; set; }
        public string Name { get; set; } = string.Empty;
        public string Category { get; set; } = string.Empty;
        public int Stock { get; set; }
        public bool Discontinued { get; set; }
    }
}

Adjust the last column's width, so that there is no empty space after it

<TelerikGrid @ref="@GridRef"
             Data="@GridData"
             Reorderable="true"
             Resizable="true"
             Width="@GridWidth"
             ShowColumnMenu="true"
             OnStateChanged="@( (GridStateEventArgs<Product> args) => OnGridStateChanged(args) )">
    <GridColumns>
        <GridCheckboxColumn SelectAll="true" />
        <GridColumn Field="@nameof(Product.Id)" />
        <GridColumn Field="@nameof(Product.Name)" />
        <GridColumn Field="@nameof(Product.Category)" />
        <GridColumn Field="@nameof(Product.Stock)" />
        <GridColumn Field="@nameof(Product.Discontinued)" />
    </GridColumns>
</TelerikGrid>

@code {
    private TelerikGrid<Product>? GridRef { get; set; }

    private List<Product> GridData { get; set; } = new();
    private string GridWidth => $"{GridIntWidth}px";

    private int GridIntWidth = 1000; // A pixel Grid width is required for this scenario
    private int GridMaxTableIntWidth => GridIntWidth - 17; // Assuming no horizontal scrolling

    private async Task OnGridStateChanged(GridStateEventArgs<Product> args)
    {
        if (args.PropertyName == "ColumnStates" && Double.Parse(args.GridState.TableWidth.Replace("px", "")) < GridMaxTableIntWidth)
        {
            args.GridState.TableWidth = $"99.9{DateTime.Now.Millisecond}%"; // Set something close to 100% instead of removing the value

            int lastVisibleColumnIndex = GetLastVisibleIndex(args.GridState.ColumnStates);
            args.GridState.ColumnStates.First(x => x.Index == lastVisibleColumnIndex).Width = "auto";

            await GridRef!.SetStateAsync(args.GridState);
        }
    }

    private int GetLastVisibleIndex(ICollection<GridColumnState> columnStates)
    {
        int index = 0;

        var visibleColumnStates = columnStates.Where(x => !x.Visible.HasValue || x.Visible.Value);

        foreach (var columnState in visibleColumnStates)
        {
            index = Math.Max(index, columnState.Index);
        }

        return index;
    }

    protected override void OnInitialized()
    {
        for (int i = 1; i <= 5; i++)
        {
            GridData.Add(new Product()
            {
                Id = i,
                Name = $"Product {i}",
                Category = $"Category {i % 4 + 1}",
                Stock = Random.Shared.Next(0, 100),
                Discontinued = i % 3 == 0
            });
        }
    }

    public class Product
    {
        public int Id { get; set; }
        public string Name { get; set; } = string.Empty;
        public string Category { get; set; } = string.Empty;
        public int Stock { get; set; }
        public bool Discontinued { get; set; }
    }
}