WebListBox.ColumnWidths

Does anyone know the reason why it doesn’t work in the WEB 2020 version, the size of the columns?

Me.ColumnCount = 2
Me.ColumnWidths = “100,100”

The Opening event handler can be used to initialize non-visual properties and settings for controls. In most cases, you should use the Shown event to initialize controls.

The property ColumnWidths does not work when it is called from Opening. Works if it is done in the Shown event.

This isn’t supposed to be true in 2020r1. Please file a bug report with a sample so we can get this cleared up for this control.

Edited to follow OP code.

This is how the weblistbox looks when that code is in the opening event:
image

This is how it looks in the Shown event:
image

I don’t understand why you say that it works by putting the code in the shown event because the width is not set at 100 pixels either way.

This has nothing to do with the original topic. Please don’t hijack the thread.

From https://docs.xojo.com/WebControl.Opening

The control has been created and the page is opening but has not been sent to the browser yet.

Notes

The Opening event handler can be used to initialize non-visual properties and settings for controls.

In most cases, you should use the Shown event to initialize controls.


Jose did a copy/paste from that docs page.

Edited my previous post to show how the WebListbox looks using that code in the Opening event and in the Shown event. I hope that has something to do with the original post.

Thanks, Greg.

Alberto, I made the test with data (sometimes the length repeated itself). I made double sure that I didn’t mess up, and if you leave the code in the Opening event with ColumnWidths, it does not work.

The same happens with HeaderAt in the Show event.

Try doing the test yourself, fill 3 columns with different sizes, and different head names. Fill them up with data that ranges from 5 to 10 rows.

Maybe, I am doing something wrong.

Sorry, I don’t fully understand your problem and it looks like I’m seeing other problems too. Can you create a sample and share it?

@AlbertoD @Jose_Fernandez_del_Valle

Here is a visual summary capturing some (but not all) of the issues you maybe experiencing. It might assist your feedback case.

Kind regards, Andrew

While this controls shouldn’t appear, the listbox always uses RowSets behind the scenes because we create an in-memory sqlite database to manage the data.

Thank you for clarifying that point @Greg_O_Lone. At what point, should those controls appear (greater than 25 rows if adding rows with AddRow)?

They shouldn’t appear at all in the config we are using because they cause issues with positioning and we aren’t using pagination.

1 Like

Thanks, Andrew.

That is what happens to me, I fixed it by adding the code where it works.

In your example, ColumnWidths is always ignored. On my end, one ColumnWidth works and the other does not.

Thanks to you, I am a step closer to migrating from XOJO 2019 to XOJO 2020.

1 Like