Declined
Last Updated: 10 Nov 2023 11:51 by ADMIN
Created by: Paul
Comments: 1
Category: Grid
Type: Feature Request
0
Please can you add the ability for the Blaazor grid to allow a PageSize="Auto", where it would automatically select a dynamic PageSize value that would fit the available grid height - avoiding scrolling or wasted space.
Unplanned
Last Updated: 18 Oct 2023 10:50 by Craig
Created by: Craig
Comments: 0
Category: Grid
Type: Feature Request
4

I would like to lock a column at a certain index in the Grid. For example, I would like to have a column on index 0 (the first column in the Grid) and it should not be reordered by any user interaction (dragging the column itself or dragging other columns in its place). 

Also if the user tries to drag a column over my locked column the drag handlers must not be present/or show that it is an invalid drop location.

===

Telerik edit:

In the meantime, a possible workaround is to:

  1. Handle the Grid OnStateChanged event.
  2. Check if args.PropertyName is equal to "ColumnStates".
  3. Check if the Index of the first Grid column (args.GridState.ColumnStates.First()) is greater than zero.
  4. Reset at least 2 column indexes, according to your preferences, so that the first column in the Grid markup is also the first column in the UI.
  5. Reset the Grid state with SetStateAsync().

 

<p>The <strong>Name</strong> column index will always be 0.
    The Grid will either move the reordered column to index 1, or put it back to its previous index (revert).</p>

<p><label><TelerikCheckBox @bind-Value="@ShouldRevertGridColumnOrder" /> Revert Invalid Column Reordering</label></p>

<TelerikGrid @ref="@GridRef"
             Data="@GridData"
             TItem="@SampleModel"
             Pageable="true"
             Sortable="true"
             Reorderable="true"
             OnStateChanged="@OnGridStateChanged">
    <GridColumns>
        <GridColumn Field="@nameof(SampleModel.Name)" Reorderable="false" />
        <GridColumn Field="@nameof(SampleModel.GroupName)" />
        <GridColumn Field="@nameof(SampleModel.Price)" />
        <GridColumn Field="@nameof(SampleModel.Quantity)" />
        <GridColumn Field="@nameof(SampleModel.StartDate)" />
        <GridColumn Field="@nameof(SampleModel.IsActive)" />
    </GridColumns>
</TelerikGrid>

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

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

    private bool ShouldRevertGridColumnOrder { get; set; }

    private IEnumerable<int>? CachedGridColumnIndexes { get; set; }

    private async Task OnGridStateChanged(GridStateEventArgs<SampleModel> args)
    {
        if (args.PropertyName == "ColumnStates")
        {
            if (args.GridState.ColumnStates.First().Index > 0 && GridRef != null)
            {
                if (ShouldRevertGridColumnOrder)
                {
                    await RevertGridColumnOrder();
                }
                else
                {
                    args.GridState.ColumnStates.First(x => x.Index == 0).Index = 1;

                    args.GridState.ColumnStates.First().Index = 0;

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

            CacheGridColumnOrder();
        }
    }

    private void CacheGridColumnOrder()
    {
        var gridColumnState = GridRef?.GetState().ColumnStates;

        if (gridColumnState != null)
        {
            CachedGridColumnIndexes = gridColumnState.Select(x => x.Index);
        }
    }

    private async Task RevertGridColumnOrder()
    {
        var gridState = GridRef?.GetState();

        if (gridState != null && CachedGridColumnIndexes != null)
        {
            for (int i = 0; i < gridState.ColumnStates.Count; i++)
            {
                gridState.ColumnStates.ElementAt(i).Index = CachedGridColumnIndexes.ElementAt(i);
            }

            await GridRef!.SetStateAsync(gridState);
        }
    }

    protected override void OnAfterRender(bool firstRender)
    {
        if (firstRender)
        {
            CacheGridColumnOrder();
        }

        base.OnAfterRender(firstRender);
    }

    protected override void OnInitialized()
    {
        var rnd = new Random();

        for (int i = 1; i <= 7; i++)
        {
            GridData.Add(new SampleModel()
            {
                Id = i,
                Name = $"Name {i}",
                GroupName = $"Group {i % 3 + 1}",
                Price = rnd.Next(1, 100) * 1.23m,
                Quantity = rnd.Next(0, 1000),
                StartDate = DateTime.Now.AddDays(-rnd.Next(60, 1000)),
                IsActive = i % 4 > 0
            });
        }
    }

    public class SampleModel
    {
        public int Id { get; set; }
        public string Name { get; set; } = string.Empty;
        public string GroupName { get; set; } = string.Empty;
        public decimal Price { get; set; }
        public int Quantity { get; set; }
        public DateTime StartDate { get; set; }
        public bool IsActive { get; set; }
    }
}

 

Unplanned
Last Updated: 17 Oct 2023 07:05 by Israel
Created by: Israel
Comments: 0
Category: Grid
Type: Feature Request
7

The TelerikCheckBoxListFilter starts working very slowly with hundreds of items or more. That includes rendering and searching in it.

A possible workaround is to put a virtual Grid inside the FilterMenuTemplate. The example below is a modified version of this one - Blazor Grid checkbox list filtering with custom data. The FilterMenuButtonsTemplate is necessary to clear the selected Grid rows when the user clears the column filter.

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

<TelerikGrid TItem="@Employee"
             OnRead="@OnReadHandler"
             Pageable="true"
             FilterMode="@( NameOptions != null ? GridFilterMode.FilterMenu : GridFilterMode.None )"
             FilterMenuType="@FilterMenuType.CheckBoxList"
             Height="400px">
    <GridColumns>
        <GridColumn Field="@(nameof(Employee.EmployeeId))" Filterable="false" />
        <GridColumn Field="@nameof(Employee.Name)">
            <FilterMenuTemplate Context="context">
                <TelerikGrid Data="@NameOptions"
                             ScrollMode="@GridScrollMode.Virtual"
                             Height="240px"
                             RowHeight="36"
                             FilterMode="@GridFilterMode.FilterRow"
                             SelectionMode="@GridSelectionMode.Multiple"
                             SelectedItems="@SelectedGridItems"
                             SelectedItemsChanged="@( (IEnumerable<NameFilterOption> newSelected) =>
                                                      GridSelectedItemsChanged(newSelected, context.FilterDescriptor) )">
                    <GridColumns>
                        <GridCheckboxColumn SelectAllMode="@GridSelectAllMode.All" />
                        <GridColumn Field="@nameof(NameFilterOption.Name)"></GridColumn>
                    </GridColumns>
                </TelerikGrid>
            </FilterMenuTemplate>
            <FilterMenuButtonsTemplate Context="filterContext">
                <TelerikButton OnClick="@(async _ => await filterContext.FilterAsync())"
                               ThemeColor="@ThemeConstants.Button.ThemeColor.Primary">Filter </TelerikButton>
                <TelerikButton OnClick="@(() => ClearFilterAsync(filterContext))">Clear</TelerikButton>
            </FilterMenuButtonsTemplate>
        </GridColumn>
        <GridColumn Field="@nameof(Employee.Team)" Title="Team" />
        <GridColumn Field="@nameof(Employee.IsOnLeave)" Title="On Vacation" />
    </GridColumns>
</TelerikGrid>

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

    private IEnumerable<NameFilterOption> SelectedGridItems { get; set; } = new List<NameFilterOption>();

    private void GridSelectedItemsChanged(IEnumerable<NameFilterOption> newSelectedItems, CompositeFilterDescriptor cfd)
    {
        SelectedGridItems = newSelectedItems;
        cfd.LogicalOperator = FilterCompositionLogicalOperator.Or;
        cfd.FilterDescriptors.Clear();
        foreach (var sgi in SelectedGridItems)
        {
            cfd.FilterDescriptors.Add(new FilterDescriptor()
            {
                Member = nameof(Employee.Name),
                MemberType = typeof(string),
                Operator = FilterOperator.IsEqualTo,
                Value = sgi.Name
            });
        }
    }

    private async Task ClearFilterAsync(FilterMenuTemplateContext filterContext)
    {
        SelectedGridItems = new List<NameFilterOption>();
        await filterContext.ClearFilterAsync();
    }

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

    //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()
    {
        // generate data that simulates the database for this example
        // the actual grid data is retrieve in its OnRead handler
        AllGridData = new List<Employee>();
        var rand = new Random();
        for (int i = 1; i <= 1000; i++)
        {
            AllGridData.Add(new Employee()
            {
                EmployeeId = i,
                Name = "Employee " + i.ToString(),
                Team = "Team " + i % 3,
                IsOnLeave = i % 2 == 0
            });
        }

        // get custom filters data. In a future version you will be able to call these methods
        // from the template initialization instead of here (or in OnRead) so that they fetch data
        // only when the user actually needs filter values, instead of always - that could improve server performance
        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; }
    }
}

Need More Info
Last Updated: 11 Oct 2023 11:45 by ADMIN
Created by: Joshua
Comments: 1
Category: Grid
Type: Feature Request
0
The options available in the grid popup edit settings are very convenient because a substantial jump in complexity/effort is needed to use a custom edit form. It would be great to have additional parameters that correspond to the window position and draggable properties. 
Unplanned
Last Updated: 05 Oct 2023 10:21 by Peter
Created by: Peter
Comments: 0
Category: Grid
Type: Feature Request
1

Currently, if I call Grid.AutoFitAllColumnsAsync "too early" it throws a null reference exception.

I am aware that this is a limitation but the behavior can be improved. For example, handle the exception and provide some useful information or give me a programmatic way to know if it's too early to call autofit.

 

Unplanned
Last Updated: 11 Sep 2023 11:13 by Reto
Created by: Reto
Comments: 0
Category: Grid
Type: Feature Request
2
Add an event that fires after the drag starts and before it ends. 
Unplanned
Last Updated: 21 Aug 2023 11:30 by Zachary
I have a Grid with Virtual Rows. When the user reaches the last row in the current Page, the Enter key will not switch to the next row which is beyond the PageSize.
Unplanned
Last Updated: 02 Aug 2023 05:31 by Walter
I want to take a row and move the mouse while holding the row at the bottom of the screen and it scrolls.  Is this feature available?  This is built in for an HTML grid.
Unplanned
Last Updated: 31 Jul 2023 10:18 by Frank
Hi

is there a way to make the Filtering in a grid work with wildcard symbols like '%' or '*' ?

I have checked the page https://docs.telerik.com/blazor-ui/common-features/filter-operators

For strings none of the possible operators seems to support wildcard symbols, they all treat it the symbol "as is" leading to no results. 

Guessing that the filtering is using Linq and Expressions so it would be nice if the FilterDescriptor constructor could accept a predicate function as parameter how the FilterValue is to be evaluated. I can see in the API reference that there is a protected method:

CreateFilterExpression(ParameterExpression parameterExpression)
but that is not usable / accessible when programmatically working with FilterDescriptor instances. 

Do you have plans for allowing wildcards in filter or offering new FilterOperators like "Regex" ? Or plans where a client could implement their own custom FilterOperators? 

Thanks

Frank
Unplanned
Last Updated: 28 Jul 2023 13:56 by Patrik Madliak
Created by: Patrik Madliak
Comments: 0
Category: Grid
Type: Feature Request
4

Selection performance suffers if the Grid has a large page size and uses child components in column templates:

https://blazorrepl.telerik.com/QHaLcVbl25YrVZU821

This is because the Grid doesn't apply performance optimizations for templates and always re-renders them.

Please expose a setting to disable re-rendering if it's not necessary.

Unplanned
Last Updated: 12 Jul 2023 10:41 by Fabian

When I define a bigger number of MultiColumn Header the rendering performance of the Grid component quickly deteriorates. 

I would like an improvement in this regard.

Declined
Last Updated: 13 Jul 2023 12:32 by ADMIN

I added a comment to this feedback post.  In this post, I made a comment on how to get Tab select working in a grid component for a combobox.

It would be nice if tab select was a parameter for any dropdown component and autocomplete. Maybe a parameter called "TabSelect"? It would need to fire before the grid component picks up the Tab key first in InCellEdit mode. 

 

If that was changed above, then the grid component could have the following:

Enter key to move down the list, and Shift-Enter keys to move up the list. Is there a way to do that currently, or could it be added?

Unplanned
Last Updated: 22 Jun 2023 10:40 by adam
Enhance the group header template context by including additional properties such as the parent group field and value.
Unplanned
Last Updated: 21 Jun 2023 11:46 by Michael
Created by: Michael
Comments: 0
Category: Grid
Type: Feature Request
1
I'd like to customize the filter menu to add another filter operator for string fields - "not ending by".
Completed
Last Updated: 30 Jun 2023 09:47 by ADMIN
Created by: Clark
Comments: 5
Category: Grid
Type: Feature Request
0

Using CheckBoxList filtering changes the filter menu for all columns. I would like to specify CheckBoxList only for certain columns, but that doesn't currently appear to be an easy option.

1) Leave as FilterMenuType "Menu" but implement a custom filter template for the columns I want. That would be the most obvious, but CheckBoxList is not a usable control on its own?

2) Or do the inverse, use FilterMenuType "CheckBoxList" and implement a custom filter template for all the columns where I don't want to use that. Seems like a lot of extra work to manually recreate default filters.

3) I guess I roll my own clone of the CheckBoxList control and use that like #1 on individual columns?

Any chance the CheckBoxList control could be publicly exposed for direct use?

Unplanned
Last Updated: 21 Jun 2023 05:56 by ADMIN
I would like the ability to AutoFit Grid Columns on each change in the grid but also allow the user to adjust the column's width manually without being adjusted back by AutoFit. 
Unplanned
Last Updated: 14 Jun 2023 14:10 by Himani

I need to lock the "expand" column in the Grid(Locked=true).

When I scroll horizontally, the first column with the expand/collapse icon scrolls out of view. I would like a way to lock it.

Unplanned
Last Updated: 05 Feb 2024 12:29 by Constantinos Petridis
Support for IDictionary and value mapper or/and custom implementations of IDictionary
Unplanned
Last Updated: 10 May 2023 09:57 by ADMIN
Created by: Andy
Comments: 3
Category: Grid
Type: Feature Request
1

Are there any plans to have the datagrid be both groupable and draggable?

Thanks,

Andy

Unplanned
Last Updated: 30 Apr 2023 04:40 by Ron Hary
Created by: Ron Hary
Comments: 1
Category: Grid
Type: Feature Request
1
I want to bind the Grid to a collection of DynamicObject.