Protect BWFC GridView TemplateField migrations from collapsing into BoundField output or losing nested controls
domain
migration-tooling
confidence
high
source
earned
Context
Use this when changing the Web Forms to Blazor CLI markup pipeline anywhere near GridView column transforms, template context handling, data-binding expression rewrites, or asp-prefix stripping. TemplateField preservation is a cross-transform behavior, so regressions can appear even when each individual transform still looks correct in isolation.
Patterns
Treat TemplateField preservation as an ordered pipeline contract:
DisplayExpressionTransform
AspPrefixTransform
DataBindingAttributeTransform
AttributeStripTransform
GridViewColumnItemTypeTransform
TemplateContextTransform
Keep regression coverage at two levels:
Transform-only markup assertions through TestHelpers.CreateDefaultPipeline().
Full-file migration assertions through MigrationPipeline.ExecuteAsync().
Cover these GridView shapes explicitly:
TemplateField with inner TextBox
TemplateField with inner CheckBox
TemplateField with inline display expression only
Mixed BoundField + TemplateField siblings
GridView with only TemplateField columns
Assert both preservation and non-regression:
Expected <TemplateField ...> count remains stable
Inner controls survive as BWFC components (<TextBox>, <CheckBox>)
ItemTemplate Context="Item" is present
No unexpected fallback <BoundField> appears for template-only columns