When adding Blazor components conditionally they always render at the end. Use this technique to render conditionally specific DataGrid column(s) and keep the render order as declared in the markup/code.
In this demo the Photo column uses showPhoto within a RenderFragment to conditionally render in the correct position (between ID and First Name), with a switch to toggle its visibility while preserving column order.
ID | First Name | Last Name | Job Title | Title | Birth Date | Hire Date | Address | City | Region | Postal Code | Country | Home Phone | Extension | Notes |
|---|
Radzen Blazor Components, © 2018-2025 Radzen.
Source Code licensed under
MIT