Example Code

Listbox with Checkboxes

Code and Documents

Attachment

Attached a vi example of a single column listbox with a checkbox to select a given row. The example shows how to use the Item Symbols of the row to simulate a user clicking on a checkbox to select/deselect the item row.  Also includes in the header row a checkbox to select/deselect ALL the rows of the control.

The VI will also return an array of strings that indicate the items that were checked by the user.

Here is the front panel:

Listbox View.JPG

Version 2:  The checkbox in the column header the 'ALL' checkbox was not entirely correct.  Now, if you select the ALL checkbox and subsequently deselect any checkboxes by the states the ALL checkbox is also deselected.  Same goes if you select all the row checkboxes the ALL checkbox will be checked.

Thanks,

PH

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
stevegirard1122
Member
Member
on

Brilliant!

Nagore
Member
Member
on

Hola buenas,

Podria alquien guare dar el ejemplo con version 8.2 o anterior? me gustaria poder verlo y no me deja porque es version 8.5

Muchas gracias!

RachelMcDaniel
Member
Member
on

Could you make a step by step video on how you did this.

Javed_H
Member
Member
on

Great Idea !!!

adrrienc
Member
Member
on

That's great

Tambrook
Member
Member
on

Very good sample. Thanks so much for sharing. One question: How do you create that Ring constant with symbol selection?

CaveDweller
Member
Member
on
Nice Work! This is very helpful example for handling the listbox events. Thank you for sharing.
Contributors