@page "/datagrid-conditional-columns-render"

<RadzenText TextStyle="TextStyle.H2" TagName="TagName.H1" class="rz-pt-8">
    DataGrid
</RadzenText>
<RadzenText TextStyle="TextStyle.Subtitle1" TagName="TagName.P" class="rz-pb-4">
    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.
</RadzenText>

<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.P" class="rz-pb-4">
    In this demo the <strong>Photo</strong> column uses <code>showPhoto</code> within a <code>RenderFragment</code> to conditionally render in the correct position (between ID and First Name), with a switch to toggle its visibility while preserving column order.
</RadzenText>

<RadzenExample ComponentName="DataGrid" Example="DataGridConditionalColumns">
    <DataGridConditionalColumns />
</RadzenExample>
