Declined
Last Updated: 08 Mar 2021 19:31 by ADMIN

---

ADMIN EDIT

This is not a bug, but intended behavior. As web grid is not Excel. You can find more details in the original thread opened by Aditya with this question: https://www.telerik.com/forums/grid-checkboxlist-filter---auto-select-all-upon-entering-filter-criteria

---

 

This is related to Grid CheckBoxList Filter - https://demos.telerik.com/blazor-ui/grid/filter-checkboxlist

In Microsoft Excel, when we start typing in the Search box, the matching entries along with "Select All" are already checked. So upon typing the required criteria, the user just needs to select Ok button to view the filtered results.

In the case of Blazor Grid, the matching entries and Select All option are not checked automatically. So the user would need to do an additional action of checking "Select All". Please refer to the attached screenshots.

Is there a way to have "Select All" auto checked upon typing the filter criteria?


Declined
Last Updated: 08 Mar 2021 12:02 by ADMIN
---

ADMIN EDIT

This is not a bug but behavior that was documented during the investigation of this case. Review the thread for more details.

---



asynct Task ContextMenuClick(ContextMenuItem) {
var state = Grid.GetState(); state.FilterDescriptors.Add(new FilterDescriptor { Member = "Created", Operator = FilterOperator.IsEqualTo, Value = "Administrator" }); await Grid.SetState(state);
}


 

How it should look like:

 


Completed
Last Updated: 02 Mar 2021 17:55 by ADMIN
Release 2.22.0
At the moment, clicking a row always alters the selection. I want to use only the GridCheckboxColumn for selection so row clicks don't change it.
Completed
Last Updated: 01 Mar 2021 08:30 by ADMIN
Release 2.23.0

Data load in background thread with selected row on UI crashing application when there is selection

 

1. Select a row
2. Click the button
3. check the server console and/or try to do something else

@using System.Collections.ObjectModel

<TelerikGrid @ref="@Grid"
             Data="@GridData"
             SelectionMode="@GridSelectionMode.Single"
             OnRowClick="@OnRowClickHandler"
             @bind-SelectedItems="@SelectedData"
             EditMode="@GridEditMode.Incell"
             Resizable="true"
             Width="100%"
             Height="200px"
             Reorderable="true"
             Groupable="false"
             ShowColumnMenu="false"
             FilterMode="@GridFilterMode.None"
             Sortable="true">
    <GridColumns>
        <GridColumn Field=@nameof(ViewModel.Name) Editable="false">
        </GridColumn>
    </GridColumns>
</TelerikGrid>

<TelerikButton OnClick="RefreshButtonClick">Refresh</TelerikButton>

@code {
    private const int RowHeight = 40;
    private const string Height = "700px";
    private const int PageSize = 20;

    private ObservableCollection<ViewModel> GridData { get; set; } = new ObservableCollection<ViewModel>();
    private IEnumerable<ViewModel> SelectedData { get; set; } = Enumerable.Empty<ViewModel>();

    private TelerikGrid<ViewModel> Grid { get; set; }

    protected override async Task OnInitializedAsync()
    {
        await LoadData();

        await base.OnInitializedAsync();
    }

    async Task LoadData()
    {
        var data = Enumerable.Range(1, 5).Select(x => new ViewModel { Name = $"name {x}" });
        GridData = new ObservableCollection<ViewModel>(data);
    }


    private async Task RefreshButtonClick()
    {
        Console.WriteLine("reload data");

        // spawn a new thread, a Timer will do as well
        await Task.Run(() =>
        {
            IEnumerable<ViewModel> data = new List<ViewModel> { new ViewModel { Name = "1" }, new ViewModel { Name = "2" }, new ViewModel { Name = "3" } };

            this.GridData.Clear();
            this.GridData.AddRange(data);
        });
    }

    private void OnRowClickHandler(GridRowClickEventArgs args)
    {
        Console.WriteLine("click to select");
        ViewModel viewModel = (ViewModel)args.Item;
        //this is here because of theincell editing, not relevant to the issue
        SelectedData = new List<ViewModel>() { viewModel };
    }

    public class ViewModel
    {
        public ViewModel()
        {
        }

        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }
    }
}

Declined
Last Updated: 25 Feb 2021 19:44 by ADMIN
Created by: Andrzej
Comments: 2
Category: Grid
Type: Feature Request
0

Hi,

Please simplify customizing Grid Popup, it should be available under Grid with build-in context and binding

I am already using your do-it-yourself example but IMHO it is too much code

Regards

Andrzej

Unplanned
Last Updated: 14 Feb 2021 09:23 by ADMIN
Created by: BlueOcean
Comments: 5
Category: Grid
Type: Feature Request
7

It would be really nice now that we have a grid loader, to be able to customize this using a custom template.

Currently it fixes even the animation type, so while we have chosen a different enum (Pulsing) for all our loaders, our grids now look different because it is not possible currently to change the grid loader beyond turning it on and off.

Unplanned
Last Updated: 08 Feb 2021 11:29 by ADMIN
I would like to use the SelectedItems as an ObservableCollection.
Unplanned
Last Updated: 08 Feb 2021 11:29 by ADMIN
I would like to use an event that fires after the SelectedItemsChanged and provide different async methods. 
Completed
Last Updated: 04 Feb 2021 03:01 by ADMIN
Release 2.22.0

The orderby clause only has one column when multicolumn sorting is enabled, you can test it with this sample.

---

ADMIN EDIT

A workaround is to replace the orderby generated by the grid with your own clause that uses the DataSourceRequest to extract all sort descriptors, here's an example:

@using System.Net.Http.Json
@using System.Text.RegularExpressions
@using Telerik.Blazor.Extensions
@using WasmApp.Shared
@inject HttpClient Http

<TelerikGrid Data=@GridData
             Height="460px"
             RowHeight="60"
             PageSize="10"
             Pageable="true"
             Sortable="true"
             FilterMode="@GridFilterMode.FilterRow"
             SortMode="@SortMode.Multiple"
             OnRead=@ReadItems
             TotalCount=@Total>
    <GridColumns>
        <GridColumn Field="ProductID" />
        <GridColumn Field="ProductName" />
        <GridColumn Field="Discontinued" />
    </GridColumns>
</TelerikGrid>

@code{
    public List<ODataProduct> GridData { get; set; } = new List<ODataProduct>();
    public int Total { get; set; } = 0;

    protected async Task ReadItems(GridReadEventArgs args)
    {
        var baseUrl = "https://demos.telerik.com/kendo-ui/service-v4/odata/Products?";

        string OdataUrl = args.Request.ToODataString();

        // replace the original orederby clause with one that contains all the order rules
        Regex x = new Regex("(orderby=)(.*?)(&)", RegexOptions.IgnoreCase);
        string actualOrderByClause = "orderby=";

        for (int i = 0; i < args.Request.Sorts.Count; i++)
        {
            if (i > 0)
            {
                actualOrderByClause += ",";
            }
            string order = args.Request.Sorts[i].SortDirection == Telerik.DataSource.ListSortDirection.Ascending ? "" : "%20desc";
            actualOrderByClause += $"{args.Request.Sorts[i].Member}{order}";
        }

        actualOrderByClause += "&";

        string OdataQueryWithMultipleOrder = x.Replace(OdataUrl, actualOrderByClause);

        //do the request as usual
        var requestUrl = $"{baseUrl}{OdataQueryWithMultipleOrder}";

        ODataResponseOrders response = await Http.GetFromJsonAsync<ODataResponseOrders>(requestUrl);

        GridData = response.Products;
        Total = response.Total;
    }
}

---

Completed
Last Updated: 04 Feb 2021 00:31 by ADMIN
Release 2.22.0

When I have a Navigable grid and I press Esc on the keyboard while editing/inserting a row, I want to do something (e.g., clean up the newly inserted row altogether from the data). Usually, I can use the OnCancel event for this, but it does not fire when pressing the Esc key on the keyboard.

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

Duplicated
Last Updated: 27 Jan 2021 10:27 by ADMIN

If a new item for a grid is created and the CreateHandler is cancelled due to some validation error, the new loading indicator does not disappear.

protected async void CreateHandler(GridCommandEventArgs args)
{

  var myItem = (MyModel) args.Item;

   if (!IsValid(myItem))
   {
       args.IsCancelled = true;
       return;
    }

   ...

}

Regards,

René

Completed
Last Updated: 27 Jan 2021 07:40 by ADMIN
Release 2.21.1

If you set args.IsCancelled=true in any CUD event handler, the loading sign will never go away.

---

ADMIN EDIT

If you don't need to cancel the event (e.g., because remote validation or data operation failed), you should avoid cancelling it - its purpose is to keep the grid in the current mode (edit/insert) when the operation fails so the user does not lose data.

That said, the loading sing should disappear in thsoe cases too, and a workaround is to disable it by setting the EnableLoaderContainer="false" parameter of the grid.

---

Completed
Last Updated: 26 Jan 2021 08:46 by ADMIN
Release 2.21.1

Using the keyboard to save items works inconsistently. When editing an item, hitting enter seems to save the change as expected. When inserting an item, however, the item is lost.

---

ADMIN EDIT

Tthe grid calls the OnUpdate handler again, not OnCreate which results in data loss - the newly inserted item is unlikely to match existing data and so it appears to be lost.

Workaround - call the OnCreate handler yourself when the ID of the record is the default for its type - for example, zero for an integer. This indicates a newly inserted record in the grid.

<TelerikGrid Data=@MyData EditMode="@GridEditMode.Inline" Pageable="true" Height="500px" Navigable="true"
             OnUpdate="@UpdateHandler" OnDelete="@DeleteHandler" OnCreate="@CreateHandler" OnCancel="@CancelHandler">
    <GridToolBar>
        <GridCommandButton Command="Add" Icon="add">Add Employee</GridCommandButton>
    </GridToolBar>
    <GridColumns>
        <GridColumn Field=@nameof(SampleData.ID) Title="ID" Editable="false" />
        <GridColumn Field=@nameof(SampleData.Name) Title="Name" />
        <GridCommandColumn>
            <GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
            <GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
            <GridCommandButton Command="Delete" Icon="delete">Delete</GridCommandButton>
            <GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">Cancel</GridCommandButton>
        </GridCommandColumn>
    </GridColumns>
</TelerikGrid>

@code {
        async Task UpdateHandler(GridCommandEventArgs args)
        {
            SampleData item = (SampleData)args.Item;

            if (item.ID == 0)
            {
                await CreateHandler(args);
            }
            else
            {
                // perform actual data source operations here through your service
                await MyService.Update(item);

                // update the local view-model data with the service data
                await GetGridData();

                Console.WriteLine("Update event is fired.");
            }
        }

        async Task DeleteHandler(GridCommandEventArgs args)
        {
            SampleData item = (SampleData)args.Item;

            // perform actual data source operation here through your service
            await MyService.Delete(item);

            // update the local view-model data with the service data
            await GetGridData();

            Console.WriteLine("Delete event is fired.");
        }

        async Task CreateHandler(GridCommandEventArgs args)
        {
            SampleData item = (SampleData)args.Item;

            // perform actual data source operation here through your service
            await MyService.Create(item);

            // update the local view-model data with the service data
            await GetGridData();

            Console.WriteLine("Create event is fired.");
        }

        async Task CancelHandler(GridCommandEventArgs args)
        {
            SampleData item = (SampleData)args.Item;

            // if necessary, perform actual data source operation here through your service

            Console.WriteLine("Cancel event is fired.");
        }


    // in a real case, keep the models in dedicated locations, this is just an easy to copy and see example
    public class SampleData
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }

    public List<SampleData> MyData { get; set; }

    async Task GetGridData()
    {
        MyData = await MyService.Read();
    }

    protected override async Task OnInitializedAsync()
    {
        await GetGridData();
    }

    // the following static class mimics an actual data service that handles the actual data source
    // replace it with your actual service through the DI, this only mimics how the API can look like and works for this standalone page
    public static class MyService
    {
        private static List<SampleData> _data { get; set; } = new List<SampleData>();

        public static async Task Create(SampleData itemToInsert)
        {
            itemToInsert.ID = _data.Count + 1;
            _data.Insert(0, itemToInsert);
        }

        public static async Task<List<SampleData>> Read()
        {
            if (_data.Count < 1)
            {
                for (int i = 1; i < 50; i++)
                {
                    _data.Add(new SampleData()
                    {
                        ID = i,
                        Name = "Name " + i.ToString()
                    });
                }
            }

            return await Task.FromResult(_data);
        }

        public static async Task Update(SampleData itemToUpdate)
        {
            var index = _data.FindIndex(i => i.ID == itemToUpdate.ID);
            if (index != -1)
            {
                _data[index] = itemToUpdate;
            }
        }

        public static async Task Delete(SampleData itemToDelete)
        {
            _data.Remove(itemToDelete);
        }
    }
}

---

 

Unplanned
Last Updated: 25 Jan 2021 08:26 by ADMIN
Created by: Jürgen
Comments: 0
Category: Grid
Type: Feature Request
14
I would like to be able to reposition the Grid Toolbar, for example, to move it to the bottom of the Grid. 
Completed
Last Updated: 22 Jan 2021 15:53 by ADMIN
Release 2.21.1
1. Replace MainLayout with TelerikDrawer https://github.com/telerik/blazor-ui/tree/master/drawer/template
2. Place simple Grid with detail template https://docs.telerik.com/blazor-ui/components/grid/hierarchy
3. Bug - Latest column from parent grid becomes disabled for sorting.

<TelerikGrid Data="salesTeamMembers" @ref="Grid" Sortable="true" FilterMode=@GridFilterMode.FilterMenu Height="780px">
    <DetailTemplate>
           <span>Any template</span>
        </DetailTemplate>
    <GridColumns>
        <GridColumn Field="Id"></GridColumn>
        <GridColumn Field="Name" ></GridColumn>
        <GridColumn Field="Order"></GridColumn>
    </GridColumns>
</TelerikGrid>

If remove detail tempate, all columns becomes availavle for sorting as expected
Completed
Last Updated: 22 Jan 2021 13:57 by ADMIN
Release 2.21.1

If the "Navigable" parameter of the Grid is set to false (its default state) and the EditMode is PopUp, there is no focus on the first input in Add/Edit mode.

Declined
Last Updated: 21 Jan 2021 17:56 by René
Created by: René
Comments: 4
Category: Grid
Type: Bug Report
1

If in a grid columns are bound to integer values which shall be treated as enum values it can be done with the FieldType parameter.

Unfortunately the new FilterMenuType.CheckBoxList does not work as expected then.

With

<GridColumn Field="@(nameof(MyModel.MyPropertyId))"
                     FieldType="@(typeof(MyPropertyEnum))"
                     Title="MyProperty"
                     FilterMenuType="@FilterMenuType.CheckBoxList">

the filter shows Integers instead of Enum-Strings.

(With FilterMenuType.Menu the filter correctly treats the values as enums)

Regards,

René

Completed
Last Updated: 19 Jan 2021 12:46 by ADMIN
Release 2.21.0
Created by: David
Comments: 4
Category: Grid
Type: Feature Request
16
We use the multi-checkbox filters in our jquery grids now and would like to use them in Blazor. Example here https://demos.telerik.com/kendo-ui/grid/filter-multi-checkboxes
Won't Fix
Last Updated: 15 Jan 2021 17:33 by ADMIN
Scheduled for 2.22.0
Created by: Rayko
Comments: 2
Category: Grid
Type: Bug Report
4

Hi Telerik team,

 

In a Blazor Grid with filters enabled the event "OnStateChanged" is fired twice when I use a filter (set, change, remove).

---

ADMIN EDIT

This behavior is expected - when the grid is filtered, there are two actions that happen:

  1. the Page is reset so that you are sure to see data if it is available (there is no guarantee that there will be enough data to show up on the current page, filtering usually reduces the number of items the grid has)
  2. the Filter is applied

This is not something we intend to change at this point.

---

To reproduce this I took one of the provided examples and added the event handler:


@page "/"

<TelerikGrid Data=@GridData
             SelectionMode="GridSelectionMode.Multiple"
             SelectedItemsChanged="@((IEnumerable<Employee> employeeList) => OnSelect(employeeList))"
             SelectedItems="@PersistedSelectedItems"
             @bind-Page="@CurrentPage"
             PageSize="@PageSize"
             Pageable="true"
             FilterMode="GridFilterMode.FilterRow"
             OnStateChanged="@((GridStateEventArgs<Employee> args) => OnStateChangedHandler(args))">
    <GridColumns>
        <GridCheckboxColumn />
        <GridColumn Field=@nameof(Employee.EmployeeId) />
        <GridColumn Field=@nameof(Employee.Name) />
        <GridColumn Field=@nameof(Employee.Team) />
    </GridColumns>
</TelerikGrid>

@if (PersistedSelectedItems != null)
{
    <ul>
        @foreach (Employee employee in PersistedSelectedItems.OrderBy(e => e.EmployeeId))
        {
            <li>
                @employee.EmployeeId
            </li>
        }
    </ul>
}

@code {
    public List<Employee> PersistedSelectedItems { get; set; } = new List<Employee>();
    int CurrentPage { get; set; }
    int PageSize { get; set; } = 5;

    private async void OnStateChangedHandler(GridStateEventArgs<Employee> args)
    {
        await Task.Delay(5000);
    }

    protected void OnSelect(IEnumerable<Employee> employees)
    {
        IEnumerable<Employee> CurrentPageEmployees = GridData.Skip(PageSize * (CurrentPage - 1)).Take(PageSize);

        if (employees == null || employees.Count() == 0)
        {
            //the user de-selected all items with the header checkbox
            PersistedSelectedItems = PersistedSelectedItems.Except(CurrentPageEmployees).ToList();
        }
        else
        {
            //handle any deselected items
            var UnselectedEmployees = CurrentPageEmployees.Except(employees);
            PersistedSelectedItems = PersistedSelectedItems.Except(UnselectedEmployees).ToList();

            //add any new items if they were not selected already
            foreach (var item in employees)
            {
                if (!PersistedSelectedItems.Contains(item))
                {
                    PersistedSelectedItems.Add(item);
                }
            }
        }
    }

    //data binding and sample data
    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; }
    }
}

Best regards,

Rayko

Completed
Last Updated: 11 Jan 2021 14:33 by ADMIN
Release 2.21.0
Created by: Dan
Comments: 2
Category: Grid
Type: Feature Request
59
When loading large datasets, it would be nice if there was an ability to trigger an animation or loading modal.  Similarly, filtering a large dataset causes a delay that can result in lost key presses when typing a few characters into the filter.  Interrupting with an animation or modal would be helpful there (as would the ability to specify a custom delay on filtering after keypress).