Open bytesfrombits opened 3 years ago
If those are also hidden on Form one alternative solution would be to not use Entity directly with Grid but to have classes EntityModel with only needed properties and use AutoMapper for transformation. This structure has some other benefits as well. If on the other hand you would need them on the From then your proposed solution would be the way to go.
This is especially for specific cases where the Columns are to be excluded from Grid but included in forms for CRUD operations.
Is your feature request related to a problem? Please describe. Currently the query generated to fetch data to populate the Grid includes ALL fields defined in the column collection whether Visible or Hidden. In cases where Hidden columns are mapped to large table fields e.g fields defined as [nvarchar] or [varchar] in MS SQL containing large sets of textual data such as voluminous reports the memory overhead to page through the Grid is very HIGH as ALL such large table fields are included in each query to populate each page of the Grid yet the data from the large table fields is not used or displayed on the Grid.
Describe the solution you'd like
Add a "GridExcluded" property to the Column object to mark a Column as totally excluded from a Grid e.g Columns.Add(o => o.Id, GridExcluded); Purpose:
As much as possible, utilise AsNoTracking() for database calls to populate the Grid with a goal to reducing the memory overhead of Entity Framework
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context This feature request would make Grid.Blazor more efficient with large datasets by reducing the memory overhead.