Automatically expand listview columns to the size of their content

Windows File Open dialog
Click for larger view.
Arrow indicates where you need to double click.

This should probably be filed under “Did you know?” Over lunch I was talking to Mark Edington about various UI-isms and he mentioned how the listview column header on Vista has no visual indicator for the splitter between columns. Specifically, he wanted to use the mouse to resize the column headers to so he could see all of the text from the items contained within that column. I mentioned the fact you can double click the splitter to automatically expand the column to the width of the content and he was like “Huh?! Is that just on the File dialog?” Nope, you can double click the splitter on any column header on any standard listview in windows and it will size to the width of the content. He said, “dude, that’s something to blog”. 🙂

[Update May 22, 2007] This is too good not to add to this post. Via Eric van der Gaag pressing Ctrl-+ (Plus key from the keypad) will adjust the size of all the columns in the listview at once! Thanks Eric.

5 thoughts on “Automatically expand listview columns to the size of their content

  1. Another feature for list views is that if you have the list view focused, if you press Ctrl+Enter, it will automatically resize all of the columns to fit the text.
    Something that people might also not know about 🙂

  2. There isn’t a day that goes by that I don’t find something new to hate about Vista…
    Of course, for this to work, you have to be in View|Details… mode -> Previously this was the only view with a set of column headers, but now every view has them to support the new filtering options.
    Unfortunately, many modes don’t have "columns" this way, but still show colunms. So this is yet ANOTHER UI feature in Vista that provides a seriously non-standard experience. Try to double click and it just screws with your sorting (which always defaults to the exact opposite direction I want. Which would be almost be fine if the default wasn’t NO sorting to begin with, and it didn’t forget it 8 times out of 10 when you do try to save your sorting preferences.. meaning you have to click twice if you have to click once… AUGH)
    I wish they would throw out ALL of the new, screwed up, deeply flawed non-consistent UI and just push the new kernel benefits back into the old XP interface which was at least consistent.

  3. Erik -> Interesting tip, as a footnote, it only works with the text on screen right that second, so as you scroll, you gotta keep adjusting it anways.
    Kinda makes it another pointless feature… <sigh>

  4. OK, I only learned about the column auto-sizing a few months ago. It’s not just on Vista, though. It works on XP and 2K, and for all I know, may even have started in NT.
    The problem is, with an OS the size of Montana, how do you keep up with all the little additions?
    By the way, is there a problem on FireFox with the code you show to validate an entry? Sometimes it shows, and sometimes not….

Comments are closed.