Keep Columns still while scrolling up and down. Excel 2010 - excel-2010

Looking to keep Columns A-C stay still whole scrolling up and down. My worksheet has a lot of information on it and i need the first columns to stay still. I've tried freezing panes, but the columns only stay still when i scroll left and right, not up and down.
Can this be done?

To keep an area of a worksheet visible while you scroll to another area of the worksheet, you can lock specific rows or columns in one area by freezing or splitting panes.
When you freeze panes, you keep specific rows or columns visible when you scroll in the worksheet. For example, you might want to keep row and column labels visible as you scroll.
A solid line indicates that row 1 is frozen to keep column labels in place when you scroll.
When you split panes, you create separate worksheet areas that you can scroll within, while rows or columns in the non-scrolled area remain visible.
https://support.office.com/en-ca/article/Freeze-or-lock-rows-and-columns-3439cfe6-010c-4d2d-a3c9-d0e8ba62d724

Related

Vaadin large table scrolls inside table (and underneath header) instead of scrolling page

Vaadin Version: 23.3.3
I have a fairly complex Vaadin table, ~100 rows, each of which contains ~12 columns, each column containing a layout with ~10 elements. The table is not lazy in any way, and is configured to show all rows at once.
It takes the browser 5+ seconds just to render the table after the request is complete (a topic for a different question) but even once the table is rendered I experience some weirdness when scrolling.
When holding the mouse outside the table, or using the scroll bar, the page always scrolls as expected. But when I hold the mouse inside the table I get inconsistent results. If I have first scrolled the page all the way to the bottom then there appears to be no issue regardless of mouse position. But If I have yet to scroll to the bottom, then the table scrolls in place, pushing rows underneath the header (see screenshot). It's as if the browser/vaadin is not yet completely aware of the size of the table?
Is there something I need to be doing to force vaadin to render the entire page?
Edit: Upon some further testing I noticed even stranger inconsistencies. My table cells have two possible layouts depending on user actions. One is simple, containing: div > span > span. The other is more complex, containing a div > span > span + vaadin-icon + tooltip. The issue only appears when the table is rendered with the "simple" layout. Something about the added vaadin-icon and tooltip seems to make vaadin draw the table without scroll issues.

Vaadin Grid: setAutoWidth(true) with recalculateColumnWidths() works only for visible rows in the grid

After I setup the a Grid with all the columns with setAutoWidth(true) and I execute grid.recalculateColumnWidths() this will auto-adapt the columns width with the content of the columns but only for the rows that are visible in the grid.
What happen is that scrolling rows in the grid I can find some cells with content larger than the content on the first visible rows and they were not auto-adapted and so the content is truncated (es FOO...)
Considering that I am using ListDataProvider, so all the rows are loaded into memory when I build the grid, why it is not calculating the right width for every column considering all the rows?
Is this a normal behaviour? It is possible to change it to consider all the rows when it is calculating the columns width?
I am using Vaadin version 14.
Thanks for the help
Yes,
this is the normal behaviour of the vaadin grid and is (at least for the 23.x) documented that way
https://vaadin.com/api/platform/23.2.6/com/vaadin/flow/component/grid/Grid.Column.html#setAutoWidth(boolean)
The relevant part, why it's not looking at all items in the grid is here:
For performance reasons the column width is calculated automatically only once when the grid items are rendered for the first time and the calculation only considers the rows which are currently rendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell content changes, the column width might not match the contents anymore.
You can however "retrigger" a width calculation
You can manually trigger the auto sizing behavior again by calling Grid.recalculateColumnWidths().

Freeze Columns in Vaadin 7 table

I have 20 columns in a vaadin 7 table, I want to freeze 4 columns so that whenever we scroll horizontally we should be able to see those frozen columns always.
There is no freeze columns feature in Vaadin 7 Table. But in newer Grid component you can set the X left most columns to be frozen with Grid.setFrozenColumnCount(..) methdod, see more here:
https://vaadin.com/api/framework/7.7.14/com/vaadin/ui/Grid.html#setFrozenColumnCount-int-
If you want to do something similar with Vaadin 7 Table, you probably need to do the following
Use two tables with the same data source Container
Wrap them inside e.g. CssLayout
Give z-index to other Table so that it is placed on top of the other in your theme CSS styles (Table.addStyleName("frozen-columns-table"))
Set the Table on top have only the "frozen" columns with setVisibleColumns(..) method
Set/style column widths etc. accordingly. The Table on top needs to be narrower than the bottom Table.
The above approach has its limitations and performance impacts, but could be a solution in some cases.

Expand UITableViewCell to occupy all remaining screen space

I've got a UITableView (filling whole screen) with several dynamic sections (these could be added/removed at any time). These sections are pulling data from various sources and if there are no data the section wouldn't show. There is one section in the middle which is always there and if there are no data for that one either it should show single row filling the whole screen (minus the header) showing label like "no data found".
So say I've got sections A, B, C, D, E. Section D is always visible but the rest might or might not be there. I'm resizing the D cell based on table's contentSize but the problem happens when there is something in section E. In that case when drawing the section D the contentSize seems to be wrong - I guess it's because at that time section E hasn't been drawn yet. It works fine when there is no section E visible.
Is there any way how I can have cell in the middle of the table dynamically resize based on how much space the table content is taking on the actual screen?
Or maybe my solution is completely wrong and there is a better way?
EDIT
I've added a picture - please excuse my terrible drawing. Basically if there is not enough data in other sections - the single cell in section D (green rectangle) should expand to take remainder of the screen in case the table content is not taking up the whole screen.
[

google spreadsheet drawing while freezing rows and columns

After my sheet is frozen for maximum amount of rows (10) and columns (5), I'm inserting a drawing as a button. I assigned a script to the button. The problem is:
I can't move that drawing into the frozen quadrants of the sheet. The drawing pushes up against the frozen border. I want that button at all times as I scroll through the worksheet. However, if the button is not in the frozen sections, but in the 4th quadrant, I have to scroll to it to push the button.
Does anybody know a way around this? How do i get that button to be always visible on a large worksheet?
This has been a long-standing issue, unfortunately (and this behaviour remains in the new version of Sheets). If you are using the new version, you might want to look into sidebars.

Resources