Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
blazejjanus opened this issue Jul 5, 2024 · 2 comments
Open

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

blazejjanus opened this issue Jul 5, 2024 · 2 comments

Comments

@blazejjanus
Copy link

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):

  • .NET Version: .NET 8
  • BlazorBootstrap: 2.2.0
  • Blazor WebAssembly / Server: Server
  • Blazor Interactive Render Mode: Server (InteractiveServer)
  • Blazor Interactivity Location: Per page/component

Desktop (please complete the following information):

  • OS: Windows 11 23H2
  • Browser: Edge 126.0.2592.87
@gvreddy04
Copy link
Contributor

@blazejjanus Thank you for using BlazorBootstrap.

Show/Hide columns is not supported at this moment.

@joselitogatchalianalonzo

I'm also waiting for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants