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

**URL:** <https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305>\
**Category:** General\
**Created:** [June 23, 2023, 7:47pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305 "2023-06-23T19:47:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 7:47pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/1 "2023-06-23T19:47:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 8:35pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/2 "2023-06-23T20:35:48Z")

</div>

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](https://forum.xojo.com/uploads/default/original/2X/a/a408d73afa8e1543ec9397007996d5345b83a3f9.png)

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.

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 8:38pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/3 "2023-06-23T20:38:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 8:40pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/4 "2023-06-23T20:40:26Z")

</div>

This is why a demo is worth a thousand words…

like this?

![image](https://forum.xojo.com/uploads/default/original/2X/5/50be1eb7cb1bff334b0f99fd4fb23ad3f9e580da.png)

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 8:42pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/5 "2023-06-23T20:42:22Z")

</div>

> [@Niles\_Mitchell](#):
>
> Well, these aren’t blank expandable rows. They are blank regular rows in a Listbox that has Expandable Rows turned on.

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

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 8:44pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/6 "2023-06-23T20:44:02Z")

</div>

![image](https://forum.xojo.com/uploads/default/original/2X/a/aa1142d6fd17b99a71b2de06ec8b9007f43d52d4.png)

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

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 8:48pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/7 "2023-06-23T20:48:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [June 23, 2023, 8:52pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/8 "2023-06-23T20:52:04Z")

</div>

Are you working with Windows, Mac or Linux?

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 8:54pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/9 "2023-06-23T20:54:12Z")

</div>

Windows

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 8:54pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/10 "2023-06-23T20:54:17Z")

</div>

Works fine here  
 ![image](https://forum.xojo.com/uploads/default/original/2X/9/93d9f55f925f0f331f3dd16a2adcef28b9422814.png)

The listbox has Allow Expandable Rows turned off.

The entries are added with AddExpandableRow

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 8:56pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/11 "2023-06-23T20:56:08Z")

</div>

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

 ![Capture](https://forum.xojo.com/uploads/default/original/2X/a/a2c93aa1837d68193a8fd3ed088c6e128f28af36.jpeg)

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 8:57pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/12 "2023-06-23T20:57:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 9:00pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/13 "2023-06-23T21:00:27Z")

</div>

Please make a small demo and post it.

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 9:00pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/14 "2023-06-23T21:00:39Z")

</div>

Define demo.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 9:01pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/15 "2023-06-23T21:01:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 9:09pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/16 "2023-06-23T21:09:10Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [June 23, 2023, 9:12pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/17 "2023-06-23T21:12:59Z")

</div>

> [@Niles\_Mitchell](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 9:13pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/18 "2023-06-23T21:13:23Z")

</div>

No, as I mentioned, they are regular rows.

AddRowAt

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [June 23, 2023, 9:14pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/19 "2023-06-23T21:14:16Z")

</div>

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](https://forum.xojo.com/uploads/default/original/2X/f/fd4548b95e739f2ddabedc1d3a94e25d0bae8755.png)

---

<div class="post-metadata">

**Author:** ![Niles\_Mitchell](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/e495f1/32.png) [@Niles\_Mitchell](https://forum.xojo.com/u/Niles_Mitchell)\
**Post date:** [June 23, 2023, 9:15pm UTC](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305/20 "2023-06-23T21:15:47Z")

</div>

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

[Next page](https://forum.xojo.com/t/empty-rows-cannot-be-highlighted-on-listbox-set-with-allow-expandable-rows/76305.md?page=2)
