# The best way for tables?

**URL:** <https://forum.xojo.com/t/the-best-way-for-tables/12056>\
**Category:** Getting Started\
**Created:** [November 2, 2013, 5:34pm UTC](https://forum.xojo.com/t/the-best-way-for-tables/12056 "2013-11-02T17:34:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hank\_Sinclair](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/e9a140/32.png) [@Hank\_Sinclair](https://forum.xojo.com/u/Hank_Sinclair)\
**Post date:** [November 2, 2013, 5:34pm UTC](https://forum.xojo.com/t/the-best-way-for-tables/12056/1 "2013-11-02T17:34:48Z")

</div>

In my program I use a SQLite data base.

Now I want to show all content of my data base in a table (columns for the items, rows for the records). Every cell should show an item of the data base and by double-clicking the cell I should be able to edit the item.

How can I achieve this?  
Is the built-in list box the best way to do this or are there 3rd party solutions to do this?

Hank

---

<div class="post-metadata">

**Author:** ![Bob\_Keeney](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bob\_Keeney](https://forum.xojo.com/u/Bob_Keeney)\
**Post date:** [November 2, 2013, 6:44pm UTC](https://forum.xojo.com/t/the-best-way-for-tables/12056/2 "2013-11-02T18:44:38Z")

</div>

You can iterate through the contents of a recordset and populate the listbox that way. You can do this via the standard ListBox control.

---

<div class="post-metadata">

**Author:** ![Dale\_Arends](https://forum.xojo.com/user_avatar/forum.xojo.com/dale_arends/32/442_2.png) [@Dale\_Arends](https://forum.xojo.com/u/Dale_Arends)\
**Post date:** [November 2, 2013, 8:29pm UTC](https://forum.xojo.com/t/the-best-way-for-tables/12056/3 "2013-11-02T20:29:34Z")

</div>

Plus you need to decide when to update the database. Do you plan to update the record every time a cell is edited? Or only when the application is exited? Or when a different row is selected? Or when the listbox loses focus? Or when the user clicks on a “Save Changes” button?

Basically, you need to determine the typical workflow and decide what approach will be safest for the data while not introducing too much overhead that might affect performance.

---

<div class="post-metadata">

**Author:** ![Gerd\_Wilmer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@Gerd\_Wilmer](https://forum.xojo.com/u/Gerd_Wilmer)\
**Post date:** [November 3, 2013, 4:45am UTC](https://forum.xojo.com/t/the-best-way-for-tables/12056/4 "2013-11-03T04:45:18Z")

</div>

Listbox is the way to go if you want to display a list of records.  
Write yourself a global method to fill the recordset from the SQL. Parameters: recordset as input, name of listbox to fill

As Dale said, if you let the user update records, though you can use a listbox, this can be messy  
It is better to let the user update one record at a time

Gerd

---

<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:55pm UTC](https://forum.xojo.com/t/the-best-way-for-tables/12056/5 "2020-10-29T16:55:21Z")

</div>


