DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

filter entries in chnlistbox

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 itThanks

0 Kudos
Message 1 of 4
(3,831 Views)

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.

Sincerely,
Jason Daming
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 4
(3,807 Views)

Hello, 

 

This forum thread is 5 years old. I recommend posting on a new or more recent thread. 

0 Kudos
Message 3 of 4
(3,061 Views)

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

0 Kudos
Message 4 of 4
(3,039 Views)