10-29-2009 10:31 AM
Hello,
I'm wondering if it's possible to filter entries in a channel selection list (chnlistbox). For instance I have two groups of data, each with voltage, current, power, etc in them. In one set of chnlistbox's I would like to display the channels from group one and in the other set from group two.
The road I was starting to go down was using the ChnListBox1_EventInitialize() routine, but I'm not sure how to delete list items (or to otherwise get them to not display).
If anyone has advice on this, I would appreciate it. Thanks.
10-30-2009 04:52 PM
butIdontwantanalias,
I have checked with R&D and it is not currently possible to filter the entires in the chnlistbox.
The current recommended way to do this is to use a regular listbox and populate the items according to your specifications.
08-25-2014 11:14 AM
Hello,
This forum thread is 5 years old. I recommend posting on a new or more recent thread.
08-26-2014 11:49 AM
Hi butIdontwantanalias,
I'd suggest that you programmatically use the filter form in the Data Portal to do the filter string matching in a Channel List Box control of your own, like this:
Set PortalDisp = Portal.Structure
PortalDisp.FilterForm.ChannelFilterText = "Gen" ' < your filter string here >
Call PortalDisp.FilterForm.Expand(1)
FOR Each Group In Data.Root.ChannelGroups
FOR Each Channel In Group.Channels
IF PortalDisp.IsElementDisplayed(Channel) THEN
i = i + 1
' add to ChnListBox
' ChnListBox.Items.Add Channel.Name, i
Msg = Msg & Channel.Name & vbCRLF
END IF
NEXT ' Channel
NEXT ' Group
MsgBox Msg
Brad Turpin
DIAdem Product Support Engineer
National Instruments