Migrate to igniteui-grid-lite v0.3.1 with declarative columns API #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates the Blazor wrapper from
igniteui-grid-litev0.0.1 to v0.3.1, implementing breaking API changes including the shift from programmatic to declarative column configuration.Breaking Changes
Declarative Column Configuration
Columns are now defined as child elements instead of via property:
Before:
After:
API Renames
Models:
IgbGridLiteSortConfiguration→IgbGridLiteSortingOptionsIgbGridLiteSortExpression→IgbGridLiteSortingExpressionProperties:
Key→Field,Type→DataType,HeaderText→HeaderSort(object) →Sortable(bool) +SortingCaseSensitive(bool?)Filter(object) →Filterable(bool) +FilteringCaseSensitive(bool?)SortConfiguration→SortingOptions,SortExpressions→SortingExpressionsMultiple(bool) →Mode(string: "single" | "multiple")Removed:
IgbColumnSortConfigurationclassIgbColumnFilterConfigurationclassIgbGridLiteSortingOptions.TriStatepropertyIgbGridLite.UpdateColumnsAsync()methodImplementation
New Components
IgbGridLiteColumn.razor- Declarative column componentIgbGridLiteColumn.razor.cs- Column properties (Field, Header, DataType, Sortable, Filterable, etc.)Updated Files
IgbColumnConfiguration,IgbGridLiteSortingExpression,IgbGridLiteSortingOptions,IgbGridLiteFilterExpressionChildContentparameter, markedColumnsas[Obsolete], removedUpdateColumnsAsync()sortingOptions/sortingExpressions, removedupdateColumnsfunctionDynamic Columns
Conditional rendering replaces imperative column updates:
Screenshots
Grid rendering with declarative columns:

Dynamic column toggling via conditional rendering:

Backward Compatibility
The
Columnsparameter remains functional but is marked[Obsolete]. Migration to declarative columns is recommended.Original prompt
Summary
The Blazor wrapper is currently using
igniteui-grid-liteversion0.0.1. It needs to be updated to match the latest API changes from version0.3.1, including the critical shift to declarative columns.Changes Required
Based on the CHANGELOG.md from
igniteui-grid-lite, the following breaking changes need to be applied:From 0.3.1
updateColumnsmethod - declarative columns can be updated directly nowFrom 0.3.0 - Column Property Renames
key→field- The field from the data that the column referencestype→dataType- The data type of the column's valuesheaderText→header- The header text of the columnFrom 0.2.0 - Sort/Filter Property Changes
sortproperty replaced with:sortable(boolean)sortingCaseSensitive(boolean)sortConfiguration(object withcompareroption)filterproperty replaced with:filterable(boolean)filteringCaseSensitive(boolean)ColumnFilterConfigurationtype (usefilteringCaseSensitiveboolean directly)From 0.1.0 - DECLARATIVE COLUMNS (CRITICAL)
Column configuration is now declarative using
<igc-grid-lite-column>child elements instead of thecolumnsproperty.Before (old API):
After (new API):
The
columnsproperty is now read-only and returns the current column configuration.From 0.1.0 - Sorting API Renames
GridSortConfigurationtype →GridLiteSortingOptionsIgcGridLite.sortConfigurationproperty →sortingOptionsIgcGridLite.sortExpressionsproperty →sortingExpressionsSortExpressiontype →SortingExpressionBaseSortExpressiontype →BaseSortingExpressionGridLiteSortingOptions.multipleboolean →modeproperty ('single'or'multiple')triStateproperty (tri-state sorting always enabled)Files to Update
src/IgniteUI.Blazor.GridLite/package.json
igniteui-grid-litedependency from~0.0.1to~0.3.1NEW: Create src/IgniteUI.Blazor.GridLite/IgbGridLiteColumn.razor
<igc-grid-lite-column>elementField,Header,DataType,Width,Hidden,Resizable,Sortable,SortingCaseSensitive,Filterable,FilteringCaseSensitiveNEW: Create src/IgniteUI.Blazor.GridLite/IgbGridLiteColumn.razor.cs
[Parameter]attributessrc/IgniteUI.Blazor.GridLite/IgbGridLite.razor
ChildContentfor declarative columns<igc-grid-lite-column>elements inside the gridsrc/IgniteUI.Blazor.GridLite/Models/IgbColumnConfiguration.cs
Key→Field(with[JsonPropertyName("field")])Type→DataType(with[JsonPropertyName("dataType")])HeaderText→Header(with[JsonPropertyName("header")])Sortobject property with:Sortable(bool) with[JsonPropertyName("sortable")]SortingCaseSensitive(bool?) with[JsonPropertyName("sortingCaseSensitive")]Filterobject property with:Filterable(bool) with[JsonPropertyName("filterable")]FilteringCaseSensitive(bool?) with[JsonPropertyName("filteringCaseSensitive")]ToJsConfig()method to use new property namessrc/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortConfiguration.cs → Rename to IgbGridLiteSortingOptions.cs
IgbGridLiteSortConfiguration→IgbGridLiteSortingOptionsMultiple(bool) withMode(string) using[JsonPropertyName("mode")]- accepts "single" or "multiple"TriStateproperty entirelysrc/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortExpression.cs → Rename to IgbGridLiteSortingExpression.cs
IgbGridLiteSortExpression→IgbGridLiteSortingExpressionKey→Fieldwith[JsonPropertyName("field")]src/IgniteUI.Blazor.GridLite/IgbGridLite.razor.cs
[Parameter] public RenderFragment? ChildContent { get; set; }for declarative columnsSortConfiguration→SortingOptions(typeIgbGridLiteSortingOptions)SortExpressions→SortingExpressions(typeIEnumerable<IgbGridLiteSortingExpression>)UpdateColumnsAsyncmethod (columns are now declarative)...
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.