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

bp:GridViewRowSelectColumn Show/Hide column bug #1860

Open
thatdbme opened this issue Sep 18, 2024 · 0 comments
Open

bp:GridViewRowSelectColumn Show/Hide column bug #1860

thatdbme opened this issue Sep 18, 2024 · 0 comments

Comments

@thatdbme
Copy link

There is a bug in the bp:GridViewRowSelectColumn implementation that prevents it from successfully being hidden or removed from a GridView which then changes the structure of the GridView's html table.

I have created a page (linked below) that demonstrates quite a few different attempted methods to show/hide the column.

Please run the example and observe the behavior.

What I would list as additional functional requirements for this column would be:

  1. The column can be added/removed without changing the order of all other columns. (It is currently changing the order of columns under some circumstances.)
  2. The column can be removed without consuming space in the grid when not actually present.
  3. Other columns can be added/removed without causing column reordering or space wasted for non-existent columns.

ShowHideColumn.dothtml (9.6 KB)
ShowHideColumnViewModel.cs (10.3 KB)

From what I can tell, the issue seems to come from the hard-coded width property of “30px” that is being set in the BuildCol(() method. When the column’s visibility is set to false, the width property (even if set to a different value) is causing the column to still take up space on the page.

Looking at the developer tools while the column is “hidden” you can see that the width element.style value is set to “30px” in the <colgroup> for the selection column. If you uncheck/remove that setting the table adjusts and is then correct. Either removing the width style property or adding display:none when the column is meant to be hidden seems to fix the issue.

Note that when a bp:GridViewRowSelectColumn is not included in the grid, showing/hiding columns seems to work correctly.

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

No branches or pull requests

2 participants