DataGrid column visible


I am trying to show/hide a column in the DataGrid using the visible parameter. A variable in C# "@ShowIPColumn" is being set with a radzen check box and visible=@ShowIPColumn is being used.

Setting the default value of "@ShowIPColumn" to false will hide the column on start up. selecting the check box and setting the value of "@ShowIPColumn" to true does not show the column. But unchecking the checkbox will show the column and checking it again will hide hide it again. The operation is completely backwards. Setting visible to false should hide the column as it does at start up? I have tried the checkbox with and without the a change tag.

I am confused as to how this actually works. The below code is with the change tag inuse, but is not needed.


                    <RadzenGridColumn Width="120px" TItem="Logs" Visible="@ShowIPColumn" Property="@IPAddress" Title="IP Adress" TextAlign="TextAlign.Left">
                        <HeaderTemplate><span style='color:black; font-weight:normal; font-size:12px'>IP Adress</span></HeaderTemplate>
                        <Template Context="logs">
                            <span style="color:black; font-weight:normal; font-size:12px">@IPAddress</span>

The @ShowIPColumn boolean is set using a checkbox:

<RadzenCheckBox Style="margin-left: 10px;" @bind-Value=@ShowIPColumn TValue="bool" Change=@(args => ShowHideCol(args, "CheckBox1")) />

private void ShowHideCol(object value, string name)
    ShowIPColumn = (bool)value;
    StateHasChanged(); //<-- using this makes no difference.

Hey @Odavis,

Thanks for the report! It will be fixed in the next update early next week - in the meantime you can use the following workardound: <RadzenCheckBox @bind-Value=@ShowIPColumn TValue="bool" Change="@(args => grid.Reload())" /> where grid is @ref of the DataGrid component.

Thats a nice work around, thank you!