Empty rows cannot be highlighted on Listbox set with "Allow Expandable Rows"

I’ve found that if I have my Listbox set to “Allow Expandable Rows”, then any empty row cannot be highlighted. I can still “technically” select them, as my Cut/Copy/Paste/Delete/Duplicate/Move code still works with them, you just cannot see that there are highlighted. Turn off “Allow Expandable Rows”, and everything works as before.

A bug? Or something special I have to do to highlight empty rows on a Listbox setup for Expandable Rows?

Expandable rows only highlights the text in windows, if there is no text, nothing can be highlighted. Maybe add some spaces in there if you want a selection?

image

You could probably get around this by doing your own painting with PaintCellBackground so you can paint to the end of the line if that is what you want.

1 Like

Well, these aren’t blank expandable rows. They are blank regular rows in a Listbox that has Expandable Rows turned on.

This is why a demo is worth a thousand words…

like this?

image

Makes no sense, as soon as you turn on expandable rows, they are expandable rows or am I having a brain fart?

1 Like

image

If this isn’t what you’re doing, please upload a little demo.

No, you have to specifically “AddExpandableRowAt”. That is different from “AddRowAt”.

Are you working with Windows, Mac or Linux?

Windows

Works fine here
image

The listbox has Allow Expandable Rows turned off.

The entries are added with AddExpandableRow

Doesn’t work here. There are blank rows above, below, and in-between. None are highlightable.

And my entries are regular rows. The Listbox is set to use Expandable Rows, but the rows that don’t work are regular blank rows.

Please make a small demo and post it.

Define demo.

Make the listbox, with a few entries that looks something similar to how your program is showing the entries, use the same settings for the listbox, and either add the data manually at design time or in the opening event of the listbox so they look similar to what you are experiencing. So I dont have to guess what you’re doing from your description and screenshots. Save it as a new binary project, upload it, and post the link here. Also, please let me know what version of xojo you’re using.

My description was fairly spot on. I’ll go over it again in detail.

  1. I have a Desktop Listbox.

  2. I have it set to “Allow Expandable Rows” because I’ll be using a mixture of regular and Expandable Rows.

  3. I have some regular rows that will be purposely blank. These regular rows are highlightable when clicked on when the Desktop Listbox is NOT set to “Allow Expandable Rows”, but when it IS set to “Allow Expandable Rows”, they are not highlightable when clicked.

  4. These regular blank rows are still there, and can be interacted with using my Cut/Copy/Delete/Move buttons. They are just not highlightable when the Desktop Listbox is set to “Allow Expandable Rows”.

How you add them? With AddExpandableRowAt even if they are not?

Julian can’t reproduce what you see, that is why a Demo is a faster way for someone to help you.

1 Like

No, as I mentioned, they are regular rows.

AddRowAt

When you turn on Allow Expandable Rows, they are now all expandable rows whether or not they have a + next to them or not.

As I mentioned above;

Expandable rows only highlights the text in windows, if there is no text, nothing can be highlighted

You could probably get around this by doing your own painting with PaintCellBackground so you can paint to the end of the line if that is what you want.

image

And yet, AddExpandableRowsAt and AddRowAt remain distinct commands that do different things.