How to compute the number of visible rows in an Weblistbox.

There is an effective way to calculate the number of visibile rows in a WebListbox?
The RowHeigth property seems something unrelated to what the browser uses.

My goal is to show an WebLitsbox without the scrollbar so loading in it only the number of rows visible.


You’re gonna need to break out the Developer Tools in Chrome (and equivalents in other browser) and examine the DOM. For your WebListBox div, inside you’ll find a table with an id like “YNkYCvJZ_rows”. You’ll want something like the offsetHeight of that object to figure out how tall it is inside the scroll region. That’s calculated client side, so you’ll need a way to send the value back to your app.


Hi Brad,
you think it is better to use another kind of control looking like an WebListbox?

WebListBox is great for what it does. I suppose if you really don’t want it to scroll, you could place a bunch of containers (as rows) down the page. With Web Edition though, you just don’t get the granular control over control metrics that you might expect from desktop. To the extent that you can, I’d suggest adapting to that reality. There are a few other WE things where adapting makes sense as well… Not trying to real-time enable controls, etc. WE is a little bit different beast.

Thank you Brad.