Giter Site home page Giter Site logo

devexpress-examples / blazor-dxgrid-select-all-rows-in-a-group Goto Github PK

View Code? Open in Web Editor NEW
0.0 33.0 0.0 940 KB

Configure the DevExpress Blazor Grid component to allow users to select and deselect all rows in a group.

License: Other

HTML 72.24% C# 27.76%
blazor blazor-grid dxgrid filtering grouping selection

blazor-dxgrid-select-all-rows-in-a-group's Introduction

Grid for Blazor - How to allow users to select and deselect all rows in a group

This example demonstrates how to configure the DevExpress Blazor Grid component to allow users to select and deselect all rows in a group.

Select and Deselect Rows in a Group

Specifics and Limitations

  • We do not recommend that you use this technique when the Grid is bound to a large dataset.
  • To support data editing, the example implements the InvalidateGroupDataItemsCache method that clears cached data. Call the method in the EditModelSaving and DataItemDeleting event handlers once you saved changes to the data source.

Overview

The Grid does not include a built-in API designed to get rows that belong to a group. To get all data items that correspond to a group's rows, the example does the following:

  1. Obtains a data collection from the database bound to the Grid.
  2. Calls the System.Linq.Dynamic.Core library's AsQueryable method to convert the collection from IEnumerable<T> to IQueryable<T>.
  3. Creates a filter predicate based on grouping and filter criteria applied to the Grid. The predicate determines whether a data item belongs to the group and meets the Grid's filter criteria.
  4. Uses the CriteriaStringToLowerConverter class to make the filter predicate case-insensitive. This conversion is necessary because Linq expression filtering is case-sensitive, while grid filtering is not.
  5. Filters the item collection based on the filter predicate.

To reduce the number of requests to the database, the example saves the result item collection and filter predicate to the GroupDataItems field of the GroupDataItemsCache object. Content of the field remains constant until the filter criteria or grouping changes. To detect such a change, the object stores field names of grouped columns and the current filter criteria in its CacheKey field.

Files to Review

Documentation

More Examples

blazor-dxgrid-select-all-rows-in-a-group's People

Contributors

svetlanamikheeva avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.