Skip to content

Grid: Conditional rendering of GridColumn is not working #310

@joselitogatchalianalonzo

Description

I have below code in my Razor file:
@if (!disableForm)
{
GridColumn TItem="OfficialBusinessLog" HeaderText="Delete"
button type="button" class="btn btn-danger" @OnClick="(async () => await DeleteLogAsync(context))"
DELETE ROW
button
GridColumn
}

My objective on above code is to hide the GridColumn when I set the disableForm=true.
In my cs file, I set disableForm = true when user clicks the Approve button. However, the GridColumn Delete is still visible.
My use case in this scenario is to prevent user from making changes on the form e.g. deleting row on the grid if the document was already approved. That's why I want to conditionally hide the GridColumn Delete.
Please let me know what's wrong with my code.

Additional Information: During the initial loading of the form and I set disableForm=true, it is working. But when I change the value of disableForm after the Grid was already rendered, it does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions