This project has moved and is read-only. For the latest updates, please go here.

Splits and AdjustToContents

Dec 30, 2010 at 6:56 PM
Edited Dec 30, 2010 at 6:58 PM

I could not find a way to define a "split" (i.e. set a split under a column heading so the column names are always visible when the user scrolls the content beneath them). [Similar to the ws.PageSetup.SetRowsToRepeatAtTop command except a "split" applies to the screen view]. Is this feature supported or do you plan to support it?

I found the "AdjustToContents" feature to be a bit limiting and was hoping for more control. For example, I had notes (longer than a typical cell width) in the first two rows (cells A1 and A2) and a spacer row before I started the headers/content on the fourth row. I wanted to limit the column width adjustment to rows 4 and below, but the feature only offers the option to adjust column width for ALL rows. My work-around was to load the headers/content and adjust the column width, then add any notes after the adjustment. It seems more intuitive to work from top-to-bottom and be able to limit column adjustment to a "range". Perhaps this capability already exists and I missed it in your documentation, but it seems like a worthwhile enhancement compared to my work-around approach.

By the way, your code and documentation are wonderful and easy to follow! The two points above are tiny issues (opportunities for improvement) and in no way reflect my overall opinion of your product.

Dec 30, 2010 at 7:28 PM

Thank you for the feedback, this is the kind of stuff I want to hear (how to do things easier and have a better experience using the API)

I like your idea about the AdjustToContents and it's very easy to implement. I'll just add the following overloads:  AdjustToContents(start[Row|Column]) and AdjustToContents(start[Row|Column], end[Row|Column])

I'll work on the split and freeze panes next. It should be easy though.

Thanks again,



Dec 31, 2010 at 4:40 AM

v0.39 has the new AdjustToContents overloads and a way to freeze panes.

The only thing I couldn't do is split the window (different than freezing the panes) in a sensible manner. Once again Open XML does things in the worst possible way. When splitting the window the split is specified in a value different than rows/columns and different than their widths. I couldn't find the formula but I'll ask around and see if I can get it.


Jan 3, 2011 at 5:44 PM

The new updates work very well! I learned the difference between "freeze panes" and "split" for the first time and realized that my application was better suited to "freeze panes" (simply pinning the header row for constant viewing, so content could scroll beneath). For my work, I am quite happy to use "freeze panes" and am not concerned that "split" is not supported.