vikramlearning / blazorbootstrap

An Enterprise-class Blazor Bootstrap Component library built on the Blazor and Bootstrap CSS frameworks.
https://docs.blazorbootstrap.com/
Apache License 2.0
594 stars 22 forks source link

Anyway to show/hide or add remove GridColumn on runtime #789

Open blazejjanus opened 1 week ago

blazejjanus commented 1 week ago

Describe the bug At first it's probably not a bug report but rather question or feature proposal, but I've not found any better place to write about it.

I have a Grid with multiple GridColumns I want to have some columns shown conditionally. In my case when user hits a button the Grid should show some additional column/columns. I've tried to achieve it like this:

@if(ShowActions) {
    <GridColumn TItem="UserModel" HeaderText="Actions" Filterable="false">
        //My content here
    </GridColumn>
}

It spawned the additional GridColumn every time the condition was met, so every time user hit the button twice (show, hide) new column was spawned. Additionally I wanted this column to be on left and it's the first column declared in my Grid, but it spawned on the right as last column. I've used such approach before with simple HTML tables and that worked fine there. I was looking for some property like Enabled, Visibility, IsHidden and so on, but didn't find anything.

Expected behavior Possibility of showing/hiding GridColumns conditionally.

Versions (please complete the following information):

Desktop (please complete the following information):

gvreddy04 commented 1 week ago

@blazejjanus Thank you for using BlazorBootstrap.

Show/Hide columns is not supported at this moment.

joselitogatchalianalonzo commented 1 week ago

I'm also waiting for this feature.