fix(demo): resolve DashboardGridDemo RenderFragment compile errors#294
fix(demo): resolve DashboardGridDemo RenderFragment compile errors#294schalling wants to merge 1 commit into
Conversation
Refactor data-driven widget rendering in DashboardGridDemo.razor to use valid RenderFragment helper methods instead of invalid Razor markup inside lambda switch arms. Preserves existing UI behavior while fixing Razor/C# parsing issues and restoring successful build.
|
Hi @schalling, thanks for taking a look at this! Quick question before we go further. When I check out Could you share the specific compile error you were hitting, along with your .NET SDK version and IDE? Just want to make sure we understand what triggered this. If there's a real issue I'd like to get it fixed properly, but if it turns out to be environment-specific then the existing code might be okay as-is. Thanks, Mathew |
|
I get errors building this page on both main and develop branches. I also tried VS and VS Code. At first we got compiler message that said you cannot have razor syntax in a switch statement, but now I get switched expression does not handle all possible values of its input type. (On the RenderDataDrivenWidgetContent content). @schalling code worked for me. |
Refactor data-driven widget rendering in DashboardGridDemo.razor to use valid RenderFragment helper methods instead of invalid Razor markup inside lambda switch arms. Preserves existing UI behavior while fixing Razor/C# parsing issues and restoring successful build.
Description
This PR fixes compilation errors in DashboardGridDemo.razor caused by invalid Razor markup inside C# lambda switch arms.
Changes made
• Refactored RenderDataDrivenWidgetContent to dispatch to dedicated RenderFragment helper methods:
• RenderBarChartWidget
• RenderAreaChartWidget
• RenderLineChartWidget
• RenderPieChartWidget
• RenderKpiWidget
• RenderTableWidget
• Kept the existing UI/content behavior intact while correcting Razor/C# structure.
Type of Change
Testing Checklist
Related Issues