Feature/ab#30910 edit dynamic dg values#2155
Merged
JamesPasta merged 7 commits intodevfrom Mar 24, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables editing of dynamic DataGrid (CHEFS-driven) column values in the row-edit modal by carrying dynamic column metadata (key/name/type) through the UI and applying type-aware formatting for both input and presentation.
Changes:
- Extend DataGrid row-edit flow to include dynamic columns as editable inputs (with type-specific rendering and formatting).
- Introduce dynamic field mapping (
DynamicFieldMap) and input/presentation formatting helpers for dynamic columns (notably Date/DateTime/Currency). - Adjust DataGrid column generation/merging and summary summation logic.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/DataGridWidget/Default.css | Updates styles used by the edit-row modal layout and adds a “static field” indicator style. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/DataGridWidget/Default.cshtml | Minor markup whitespace change in the DataGrid widget view. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/DataGridWidget/DataGridWidget.cs | Attempts to dedupe generated columns; enables editing in dynamic/no-columns preview; refactors cell summation loop. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml.cs | Adds dynamic field prefixing, dynamic type/name map handling, checkbox normalization, and dynamic DateTime storage conversion. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml | Renders dynamic fields as editable (type-aware) controls; merges dynamic+custom fields into one list; adds “predefined column” icon/tooltip. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/DataGridServiceUtils.cs | Adds Date/DateTime formatting support and replaces dynamic extraction with richer DynamicFieldMap values. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/DataGridReadService.cs | Updates API to return DynamicFieldMap[] and excludes custom-column keys from dynamic extraction. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Shared/DataGridExtensions.cs | Adds ApplyInputFormatting and DateTime offset normalization for HTML input compatibility. |
Comments suppressed due to low confidence (1)
applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/DataGridWidget/DataGridWidget.cs:152
- GenerateDataColumns mixes
KeyandNamewhen detecting existing columns:existingKeysis built fromdataColumns.Select(c => c.Key)but the filter compares againstDataGridDefinitionColumn.Name, and new columns are added withKey = dataColumn.Name. This can lead to missing or duplicated columns when existingDataGridValue.Columnskeys don’t match names (e.g., dynamic grids whereKeycomes from schema andNameis a label). Use a consistent identifier (preferablyKey) for both the hash set and the comparison, and set the added column’sKeyaccordingly (or, if the intended de-dupe is by display name, build the set fromc.Nameinstead).
List<DataGridColumn> dataColumns = dataGridValue?.Columns ?? [];
var existingKeys = new HashSet<string>(dataColumns.Select(c => c.Key), StringComparer.Ordinal);
foreach (var dataColumn in (dataGridDefinition?.Columns ?? []).Where(c => !existingKeys.Contains(c.Name)))
{
dataColumns.Add(new DataGridColumn()
{
Key = dataColumn.Name,
Name = dataColumn.Name,
Type = dataColumn.Type
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...r/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml.cs
Show resolved
Hide resolved
...r/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml.cs
Outdated
Show resolved
Hide resolved
...ager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml
Outdated
Show resolved
Hide resolved
...ager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml
Outdated
Show resolved
Hide resolved
...ager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml
Outdated
Show resolved
Hide resolved
JamesPasta
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enables editing of dynamic DataGrid (CHEFS-driven) column values in the row-edit modal by carrying dynamic column metadata (key/name/type) through the UI and applying type-aware formatting for both input and presentation.
Changes:
Extend DataGrid row-edit flow to include dynamic columns as editable inputs (with type-specific rendering and formatting).
Introduce dynamic field mapping (DynamicFieldMap) and input/presentation formatting helpers for dynamic columns (notably Date/DateTime/Currency).
Adjust DataGrid column generation/merging and summary summation logic.