Pull data from one Array based on data in first Array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kieran

    Pull data from one Array based on data in first Array


    Hi,

    I have a string Array called Groups and this has x number of groups.
    Each row of the Array is divided up by ';' and has the name of the
    group in the second position (i.e. after the first ';') and then x
    number of values all divided by ';'. All these subsequent values are
    the IDs of the contacts of the group

    I then have a second string Array called Contacts and this has x number
    of contacts.
    Each row of the Contacts Array is divided by ';' and has the ID of the
    contact first and the mobile number of the contact in the third
    position (i.e. after the second ';')

    I want to put the Group names into a drop down and dependent on the
    group name picked...pull the mobile numbers of the Contacts of that
    Group into a string.

    I can get the Group names into the drop down but am unsure how to pull
    the information from the second Array based on the Group name selected.

    I know i have probably explained this badly but if anyone understands
    and could give me some pointers, it would be much appreciated.

    Thanks....

  • Chris

    #2
    Re: Pull data from one Array based on data in first Array

    kieran wrote:[color=blue]
    > Hi,
    >
    > I have a string Array called Groups and this has x number of groups.
    > Each row of the Array is divided up by ';' and has the name of the
    > group in the second position (i.e. after the first ';') and then x
    > number of values all divided by ';'. All these subsequent values are
    > the IDs of the contacts of the group
    >
    > I then have a second string Array called Contacts and this has x number
    > of contacts.
    > Each row of the Contacts Array is divided by ';' and has the ID of the
    > contact first and the mobile number of the contact in the third
    > position (i.e. after the second ';')
    >
    > I want to put the Group names into a drop down and dependent on the
    > group name picked...pull the mobile numbers of the Contacts of that
    > Group into a string.
    >
    > I can get the Group names into the drop down but am unsure how to pull
    > the information from the second Array based on the Group name selected.
    >
    > I know i have probably explained this badly but if anyone understands
    > and could give me some pointers, it would be much appreciated.
    >
    > Thanks....
    >[/color]

    I would think of breaking up your array (at least the second one) and
    put it in a datatable. This way you can filter the datatable in a
    dataview based on the selected in combobox1. Then apply the filtered
    dataview to the datasource of the second combobox.


    Chris

    Comment

    Working...