The workaround is not terribly complicated, but requires JavaScript.
The Weblistbox headers is a table, which ID is the Weblistbox ControlID+"_headers"
The Weblistbox rows is a table, which ID is the Weblistbox ControlID+"_content"
What you can do in JavaScript is cycle through the td in the first row of content and for each td get offsetWidth, then apply that width to the corresponding td in headers.
Ok. So… I dont have any idea how to do this!
I looked at the developer tools in chrome and I can see the list box table element, Im guessing getelementbyid is part of it and control.executejavascript but these are just guesses is there anything in the Xojo examples that might point me in the right direction?
I just worked quickly on the problem, and it seems offsetWidth does not report the accurate width of columns for the content of the table, resulting in an offset anyway.
Sorry, it does not seem to work as expected.
Here is the JavaScript in case someone else has a better idea :
[quote=366343:@Michel Bujardet]I just worked quickly on the problem, and it seems offsetWidth does not report the accurate width of columns for the content of the table, resulting in an offset anyway.
Sorry, it does not seem to work as expected.
Here is the JavaScript in case someone else has a better idea :
is the control ID I replaceAll before executeJavaScript.[/quote]
I remember having same problem and once refreshed the page the table looks properly , I raised the issue and XOJO team I guess they told me that I should not use dynamic width and go with fix one and it will work but never tested honestly as it was an in-house app to help us with some stats.
I thought Id replied earlier but it didnt appear somehow!
Anyway thanks for the link. Ive had a test of a few things and it seems that the cell values are actually aligned wrongly when the columnstyle is set to right aligned.
There is no way to rightpad the values and the text ends up in the next column. I also tried to add some spaces to the end of the cell text but it had no effect so I think Im missing something!
Ill continue to test and see if I can make sense of it