# One cell select in WebListbox?

**URL:** <https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574>\
**Category:** Getting Started\
**Created:** [October 11, 2013, 7:26am UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574 "2013-10-11T07:26:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Lehmann](https://forum.xojo.com/user_avatar/forum.xojo.com/lars_lehmann/32/11818_2.png) [@Lars\_Lehmann](https://forum.xojo.com/u/Lars_Lehmann)\
**Post date:** [October 11, 2013, 7:26am UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/1 "2013-10-11T07:26:39Z")

</div>

Hi,  
is there a possibility to select only one cell instead the whole row in a (web-) listbox?

---

<div class="post-metadata">

**Author:** ![Lars\_Lehmann](https://forum.xojo.com/user_avatar/forum.xojo.com/lars_lehmann/32/11818_2.png) [@Lars\_Lehmann](https://forum.xojo.com/u/Lars_Lehmann)\
**Post date:** [October 15, 2013, 7:31am UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/2 "2013-10-15T07:31:35Z")

</div>

No Ideas???

---

<div class="post-metadata">

**Author:** ![Mark\_Pastor1](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@Mark\_Pastor1](https://forum.xojo.com/u/Mark_Pastor1)\
**Post date:** [October 15, 2013, 12:41pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/3 "2013-10-15T12:41:31Z")

</div>

Capture the cellclick event. Keep row, column properties to remember which cell is selected. Change the cell style to one that makes it look selected.

Does that help?

---

<div class="post-metadata">

**Author:** ![Lars\_Lehmann](https://forum.xojo.com/user_avatar/forum.xojo.com/lars_lehmann/32/11818_2.png) [@Lars\_Lehmann](https://forum.xojo.com/u/Lars_Lehmann)\
**Post date:** [October 15, 2013, 2:44pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/4 "2013-10-15T14:44:22Z")

</div>

Not really, cause the selcted Row is also displayed in blue!

Or do I something wrong?

---

<div class="post-metadata">

**Author:** ![Mark\_Pastor1](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@Mark\_Pastor1](https://forum.xojo.com/u/Mark_Pastor1)\
**Post date:** [October 15, 2013, 2:50pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/5 "2013-10-15T14:50:53Z")

</div>

I believe you can:

Listbox1.selected(row) = False

to deselect the row prior to setting the style for the cell.

---

<div class="post-metadata">

**Author:** ![Lars\_Lehmann](https://forum.xojo.com/user_avatar/forum.xojo.com/lars_lehmann/32/11818_2.png) [@Lars\_Lehmann](https://forum.xojo.com/u/Lars_Lehmann)\
**Post date:** [October 15, 2013, 3:03pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/6 "2013-10-15T15:03:54Z")

</div>

This is my code, but it works only on the second click…

[code] dim R as integer  
dim C as integer

for R = 0 to ListBox1.RowCount -1  
for C = 0 to 2  
ListBox1.CellStyle(R,C) = Tabelle\_UNselected  
next C  
next R

ListBox1.CellStyle(row, column) = Tabelle\_Selected

Listbox1.Selected(row) = False[/code]

---

<div class="post-metadata">

**Author:** ![Mark\_Pastor1](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@Mark\_Pastor1](https://forum.xojo.com/u/Mark_Pastor1)\
**Post date:** [October 15, 2013, 5:23pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/7 "2013-10-15T17:23:34Z")

</div>

I would put

Listbox1.selected(row) = false

before the rest of the code rather than after it.

---

<div class="post-metadata">

**Author:** ![Lars\_Lehmann](https://forum.xojo.com/user_avatar/forum.xojo.com/lars_lehmann/32/11818_2.png) [@Lars\_Lehmann](https://forum.xojo.com/u/Lars_Lehmann)\
**Post date:** [October 15, 2013, 6:18pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/8 "2013-10-15T18:18:48Z")

</div>

nope, same result…

☹

---

<div class="post-metadata">

**Author:** ![Lars\_Lehmann](https://forum.xojo.com/user_avatar/forum.xojo.com/lars_lehmann/32/11818_2.png) [@Lars\_Lehmann](https://forum.xojo.com/u/Lars_Lehmann)\
**Post date:** [October 23, 2013, 9:36am UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/9 "2013-10-23T09:36:08Z")

</div>

no other ideas? ☹

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:53pm UTC](https://forum.xojo.com/t/one-cell-select-in-weblistbox/11574/10 "2020-10-29T16:53:37Z")

</div>


