# Weblistbox 2021r2.1 - is there a way to set column widths?

**URL:** <https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027>\
**Category:** General\
**Created:** [August 13, 2021, 7:50pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027 "2021-08-13T19:50:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Brannen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@Benjamin\_Brannen](https://forum.xojo.com/u/Benjamin_Brannen)\
**Post date:** [August 13, 2021, 7:50pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/1 "2021-08-13T19:50:22Z")

</div>

Reading through the forum, I see several entries that suggest that the column widths work for WEBLISTBOX - however those could be older versions.

Am I doing something wrong, does the WebListbox work for setting column widths?  
I’ve tried putting the values in the properties, shownEvent, and in code.

Example:  
Shown event  
Me.ColumnWidths = “5,5,100”

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [August 13, 2021, 7:56pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/2 "2021-08-13T19:56:13Z")

</div>

This is a bug in the WebListBox. It’s been marked as reproducible in Feedback, but has not been addressed as of yet.

\<[https://xojo.com/issue/62938](https://xojo.com/issue/62938)\>

Just in case you’re looking for an alternative to the built-in WebListBox with tons of features, there’s always [GraffitiGrid for Web](https://demo2.graffitisuite.com/#grid).

---

<div class="post-metadata">

**Author:** ![Benjamin\_Brannen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@Benjamin\_Brannen](https://forum.xojo.com/u/Benjamin_Brannen)\
**Post date:** [August 13, 2021, 8:26pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/3 "2021-08-13T20:26:14Z")

</div>

Thank you Anthony. I’m aware of GraffitiSuite, but it’s really expensive for me for just a listbox. I know it would get the job done and the suite looks really good. But for what I do, it’s hard for me to justify the expense.

Would you happen to know of any others for web? for example just a weblistbox so I don’t have to purchase a bunch of objects I won’t ever use?

Again thanks for confirming that it does not currently work.

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [August 13, 2021, 8:29pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/4 "2021-08-13T20:29:03Z")

</div>

Just for clarity, the columns of the WebListBox will currently fix the contents, so if you had two pictures followed by text, the text column would do its best to fit the longest line.

That said, in the web world it’s unlikely that you’ll get a column width of 5px with the padding that’s automatically applied.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [August 13, 2021, 8:30pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/5 "2021-08-13T20:30:53Z")

</div>

I won’t get in to the merits of the over 50+ other components you get with the Suite, but the short answer would be no, I don’t know of any others.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Brannen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@Benjamin\_Brannen](https://forum.xojo.com/u/Benjamin_Brannen)\
**Post date:** [August 13, 2021, 8:36pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/6 "2021-08-13T20:36:35Z")

</div>

5px was just randomly picked for an example. Greg, are you saying that the column will always be set to the width of text regardless? One of the features I like to put in for user apps is remembering the width, order, and sortOrder of columns they have selected. I store that in the database and when the user launches again, I will restore their settings.

Many times a user might pull the width over the data so they can see just a few characters of a column. Also (at least in desktop versions) it’s easier to ‘hide’ a column by just setting it’s width to zero (means the user does not want to see the column) and for me it makes the coding much easier and for the user makes the GUI faster. If they choose to show the column again, the column width is just changed back. Very fast.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Brannen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@Benjamin\_Brannen](https://forum.xojo.com/u/Benjamin_Brannen)\
**Post date:** [August 13, 2021, 8:38pm UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/7 "2021-08-13T20:38:13Z")

</div>

I understand. Thanks. 🙂

---

<div class="post-metadata">

**Author:** ![Benjamin\_Brannen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@Benjamin\_Brannen](https://forum.xojo.com/u/Benjamin_Brannen)\
**Post date:** [August 14, 2021, 5:36am UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/8 "2021-08-14T05:36:05Z")

</div>

I purchased the GraffitiSuite for it’s grid control.  
Is there a way to turn on a horizontal scrollbar and have the sum of the column widths wider than the width of the screen?

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [August 14, 2021, 5:41am UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/9 "2021-08-14T05:41:09Z")

</div>

You should review the [documentation](https://graffitisuite.com/wiki/doku.php?id=web2:grid2) and example project. There’s a lot to take in.

You’ll want to set the ForceFitColumns property to False then define widths how you want them on each column when creating the [GraffitiGridColumn](https://graffitisuite.com/wiki/doku.php?id=web2:grid2column) instance. You can define columns as either having a pixel or percentage width using the WidthType property of a column with the WidthTypes enumeration.

I also ask that you open tickets via the [support](https://support.graffitisuite.com/) system for questions, requests, or issues. I rely on it heavily to keep up with my work.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Brannen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@Benjamin\_Brannen](https://forum.xojo.com/u/Benjamin_Brannen)\
**Post date:** [August 14, 2021, 5:58am UTC](https://forum.xojo.com/t/weblistbox-2021r2-1-is-there-a-way-to-set-column-widths/65027/10 "2021-08-14T05:58:36Z")

</div>

Well - I have no idea why the first several hours produced no results. I did read the documentation and look at the examples. Although I didn’t find the scrollbar example specifically I assumed I knew enough to make it work. I must have missed a setting somewhere and reset it subconsciously. As soon as I read your post and set a font size - and tried it again, the columns started resizing as I expected but still no horizontal scrollbar. I’ll use the support ticket system in the future. Thanks.
