Home All Groups Group Topic Archive Search About

ListBox, ComboBox Bug???

Author
13 Sep 2006 5:29 PM
samoore33
I am trying to dynamically add items to a listbox or combobox. The
items add to either, but when I look through those items, there is
nothing there. If I choose an item, it shows up.

Not sure why, but the items are not visible in the listbox or combobox
until one of the items has been chosen. This of course is not good,
since someone can not see the items they need to choose from.

Any help would be appreciated.

Scott Moore

Author
13 Sep 2006 6:46 PM
rowe_newsgroups
What's the code you're using to populate them?

Thanks,

Seth Rowe

samoore33 wrote:
Show quoteHide quote
> I am trying to dynamically add items to a listbox or combobox. The
> items add to either, but when I look through those items, there is
> nothing there. If I choose an item, it shows up.
>
> Not sure why, but the items are not visible in the listbox or combobox
> until one of the items has been chosen. This of course is not good,
> since someone can not see the items they need to choose from.
>
> Any help would be appreciated.
>
> Scott Moore
Author
13 Sep 2006 7:06 PM
samoore33
Duh, brainfart! I acquired this PC from a previous programmer, he had
not updated to 1.1 Framework, could that be the problem. The form I am
working with may have been written on the 2.0 Framework.

myDataSet.ReadXML("this.xml")

The dataset has three tables in it. I use the foundRows DataRow to get
the id to match up the items in the third table.

'Used to searchthrough the dataset
                    Dim t As DataTable
                    t = myDataSet.Tables("State")
                    Dim strExpr = "id = '" &
returnItems.SubItems.Item(count).Text & "'"
                    Dim foundRows() As DataRow
                    'returns the datarows that were found in the search
                    foundRows = t.Select(strExpr)

Dim taxRow() As DataRow 'creates the tax row to be looped through to
populate the combobox

                    'Searches through the tax tabel of the dataset
                    taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
'" & foundRows(0)(2) & "'")

                    'Populates the combo box for updating purposes
                    If taxRow.Length > 1 Then
                        Dim cnt As Integer
                        For cnt = 0 To taxRow.Length - 1
                            Dim k As Integer
                            For k = 2 To 2
                               'I only need the second row out of the
datarow

cmbTest.Items.Add((taxRow(count)(k)).ToString())
                            Next
                        Next
                    End If




rowe_newsgroups wrote:
Show quoteHide quote
> What's the code you're using to populate them?
>
> Thanks,
>
> Seth Rowe
>
> samoore33 wrote:
> > I am trying to dynamically add items to a listbox or combobox. The
> > items add to either, but when I look through those items, there is
> > nothing there. If I choose an item, it shows up.
> >
> > Not sure why, but the items are not visible in the listbox or combobox
> > until one of the items has been chosen. This of course is not good,
> > since someone can not see the items they need to choose from.
> >
> > Any help would be appreciated.
> >
> > Scott Moore
Author
14 Sep 2006 12:03 AM
rowe_newsgroups
Well, nothing I see would make the combobox's contents "invisible."
Does a certain event fire this code? If you could, please post that
code too (everything from sub to end sub), I have a feeling you might
be calling this code in the wrong event. Also your below code shouldn't
need the inner for next loop - so you could change this:

>   If taxRow.Length > 1 Then
>       Dim cnt As Integer
>       For cnt = 0 To taxRow.Length - 1
>           Dim k As Integer
>               For k = 2 To 2
>                  'I only need the second row out of the datarow
>                  cmbTest.Items.Add((taxRow(count)(k)).ToString())
>               Next
>        Next
>   End If

to this:

   If taxRow.Length > 1 Then
       Dim cnt As Integer
       For cnt = 0 To taxRow.Length - 1
          'I only need the second row out of the datarow
          cmbTest.Items.Add((taxRow(count)(2)).ToString())
       Next
   End If

Thanks,

Seth Rowe


samoore33 wrote:
Show quoteHide quote
> Duh, brainfart! I acquired this PC from a previous programmer, he had
> not updated to 1.1 Framework, could that be the problem. The form I am
> working with may have been written on the 2.0 Framework.
>
> myDataSet.ReadXML("this.xml")
>
> The dataset has three tables in it. I use the foundRows DataRow to get
> the id to match up the items in the third table.
>
> 'Used to searchthrough the dataset
>                     Dim t As DataTable
>                     t = myDataSet.Tables("State")
>                     Dim strExpr = "id = '" &
> returnItems.SubItems.Item(count).Text & "'"
>                     Dim foundRows() As DataRow
>                     'returns the datarows that were found in the search
>                     foundRows = t.Select(strExpr)
>
> Dim taxRow() As DataRow 'creates the tax row to be looped through to
> populate the combobox
>
>                     'Searches through the tax tabel of the dataset
>                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> '" & foundRows(0)(2) & "'")
>
>                     'Populates the combo box for updating purposes
>                     If taxRow.Length > 1 Then
>                         Dim cnt As Integer
>                         For cnt = 0 To taxRow.Length - 1
>                             Dim k As Integer
>                             For k = 2 To 2
>                                'I only need the second row out of the
> datarow
>
> cmbTest.Items.Add((taxRow(count)(k)).ToString())
>                             Next
>                         Next
>                     End If
>
>
>
>
> rowe_newsgroups wrote:
> > What's the code you're using to populate them?
> >
> > Thanks,
> >
> > Seth Rowe
> >
> > samoore33 wrote:
> > > I am trying to dynamically add items to a listbox or combobox. The
> > > items add to either, but when I look through those items, there is
> > > nothing there. If I choose an item, it shows up.
> > >
> > > Not sure why, but the items are not visible in the listbox or combobox
> > > until one of the items has been chosen. This of course is not good,
> > > since someone can not see the items they need to choose from.
> > >
> > > Any help would be appreciated.
> > >
> > > Scott Moore
Author
15 Sep 2006 5:18 PM
samoore33
The event that calls this is when the user selects an item out of the
listview. Code is below:

Private Sub lsvTest_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lsvTest.SelectedIndexChanged

        'Clears the items in the combbo box
        cmbTest.Items.Clear()

        Dim TaxData As CRTTaxDataSet = New CRTTaxDataSet

        'Reads the xml into the dataset
        myDataSet.ReadXml("this.xml")

        'dim variables to be used
        Dim returnItems As ListViewItem =
Me.GetSelectedListViewItem(lsvTest.Items)
        Dim item As String
        Dim count As Integer

        'loops through the item that has been selected to populate the
text boxes
        For count = 0 To returnItems.SubItems.Count - 1
            Select Case count
                'Populates the corresponding textbox and old value
textbox for comparison for updating
            Case 1
                    cboState.SelectedItem =
returnItems.SubItems.Item(count).Text

                    'Used to searchthrough the dataset
                    Dim t As DataTable
                    t = myDataSet.Tables("State")
                    Dim strExpr = "id = '" &
returnItems.SubItems.Item(count).Text & "'"
                    Dim foundRows() As DataRow
                    'returns the datarows that were found in the search
                    foundRows = t.Select(strExpr)

                    Dim taxRow() As DataRow 'creates the tax row to be
looped through to populate the combobox

                    'Searches through the tax tabel of the dataset
                    taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
'" & foundRows(0)(2) & "'", "Value")

                    'Populates the combo box for updating purposes
                    Dim cnt As Integer
                    For cnt = 0 To taxRow.Length - 1
                        Dim k As Integer
                        For k = 0 To 2
                            If k = 2 Then

cmbTest.Items.Add((taxRow(cnt)(k)).ToString())
                            End If
                        Next
                    Next
            End Select
        Next

        'Clears the dataset
        myDataSet.Clear()

    End Sub

rowe_newsgroups wrote:
Show quoteHide quote
> Well, nothing I see would make the combobox's contents "invisible."
> Does a certain event fire this code? If you could, please post that
> code too (everything from sub to end sub), I have a feeling you might
> be calling this code in the wrong event. Also your below code shouldn't
> need the inner for next loop - so you could change this:
>
> >   If taxRow.Length > 1 Then
> >       Dim cnt As Integer
> >       For cnt = 0 To taxRow.Length - 1
> >           Dim k As Integer
> >               For k = 2 To 2
> >                  'I only need the second row out of the datarow
> >                  cmbTest.Items.Add((taxRow(count)(k)).ToString())
> >               Next
> >        Next
> >   End If
>
> to this:
>
>    If taxRow.Length > 1 Then
>        Dim cnt As Integer
>        For cnt = 0 To taxRow.Length - 1
>           'I only need the second row out of the datarow
>           cmbTest.Items.Add((taxRow(count)(2)).ToString())
>        Next
>    End If
>
> Thanks,
>
> Seth Rowe
>
>
> samoore33 wrote:
> > Duh, brainfart! I acquired this PC from a previous programmer, he had
> > not updated to 1.1 Framework, could that be the problem. The form I am
> > working with may have been written on the 2.0 Framework.
> >
> > myDataSet.ReadXML("this.xml")
> >
> > The dataset has three tables in it. I use the foundRows DataRow to get
> > the id to match up the items in the third table.
> >
> > 'Used to searchthrough the dataset
> >                     Dim t As DataTable
> >                     t = myDataSet.Tables("State")
> >                     Dim strExpr = "id = '" &
> > returnItems.SubItems.Item(count).Text & "'"
> >                     Dim foundRows() As DataRow
> >                     'returns the datarows that were found in the search
> >                     foundRows = t.Select(strExpr)
> >
> > Dim taxRow() As DataRow 'creates the tax row to be looped through to
> > populate the combobox
> >
> >                     'Searches through the tax tabel of the dataset
> >                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> > '" & foundRows(0)(2) & "'")
> >
> >                     'Populates the combo box for updating purposes
> >                     If taxRow.Length > 1 Then
> >                         Dim cnt As Integer
> >                         For cnt = 0 To taxRow.Length - 1
> >                             Dim k As Integer
> >                             For k = 2 To 2
> >                                'I only need the second row out of the
> > datarow
> >
> > cmbTest.Items.Add((taxRow(count)(k)).ToString())
> >                             Next
> >                         Next
> >                     End If
> >
> >
> >
> >
> > rowe_newsgroups wrote:
> > > What's the code you're using to populate them?
> > >
> > > Thanks,
> > >
> > > Seth Rowe
> > >
> > > samoore33 wrote:
> > > > I am trying to dynamically add items to a listbox or combobox. The
> > > > items add to either, but when I look through those items, there is
> > > > nothing there. If I choose an item, it shows up.
> > > >
> > > > Not sure why, but the items are not visible in the listbox or combobox
> > > > until one of the items has been chosen. This of course is not good,
> > > > since someone can not see the items they need to choose from.
> > > >
> > > > Any help would be appreciated.
> > > >
> > > > Scott Moore
Author
22 Sep 2006 2:46 AM
Easton
Check that the drawmode property of the checkbox is set to "Normal".

Show quoteHide quote
"samoore33" wrote:

> The event that calls this is when the user selects an item out of the
> listview. Code is below:
>
> Private Sub lsvTest_SelectedIndexChanged(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles lsvTest.SelectedIndexChanged
>
>         'Clears the items in the combbo box
>         cmbTest.Items.Clear()
>
>         Dim TaxData As CRTTaxDataSet = New CRTTaxDataSet
>
>         'Reads the xml into the dataset
>         myDataSet.ReadXml("this.xml")
>
>         'dim variables to be used
>         Dim returnItems As ListViewItem =
> Me.GetSelectedListViewItem(lsvTest.Items)
>         Dim item As String
>         Dim count As Integer
>
>         'loops through the item that has been selected to populate the
> text boxes
>         For count = 0 To returnItems.SubItems.Count - 1
>             Select Case count
>                 'Populates the corresponding textbox and old value
> textbox for comparison for updating
>             Case 1
>                     cboState.SelectedItem =
> returnItems.SubItems.Item(count).Text
>
>                     'Used to searchthrough the dataset
>                     Dim t As DataTable
>                     t = myDataSet.Tables("State")
>                     Dim strExpr = "id = '" &
> returnItems.SubItems.Item(count).Text & "'"
>                     Dim foundRows() As DataRow
>                     'returns the datarows that were found in the search
>                     foundRows = t.Select(strExpr)
>
>                     Dim taxRow() As DataRow 'creates the tax row to be
> looped through to populate the combobox
>
>                     'Searches through the tax tabel of the dataset
>                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> '" & foundRows(0)(2) & "'", "Value")
>
>                     'Populates the combo box for updating purposes
>                     Dim cnt As Integer
>                     For cnt = 0 To taxRow.Length - 1
>                         Dim k As Integer
>                         For k = 0 To 2
>                             If k = 2 Then
>
> cmbTest.Items.Add((taxRow(cnt)(k)).ToString())
>                             End If
>                         Next
>                     Next
>             End Select
>         Next
>
>         'Clears the dataset
>         myDataSet.Clear()
>
>     End Sub
>
> rowe_newsgroups wrote:
> > Well, nothing I see would make the combobox's contents "invisible."
> > Does a certain event fire this code? If you could, please post that
> > code too (everything from sub to end sub), I have a feeling you might
> > be calling this code in the wrong event. Also your below code shouldn't
> > need the inner for next loop - so you could change this:
> >
> > >   If taxRow.Length > 1 Then
> > >       Dim cnt As Integer
> > >       For cnt = 0 To taxRow.Length - 1
> > >           Dim k As Integer
> > >               For k = 2 To 2
> > >                  'I only need the second row out of the datarow
> > >                  cmbTest.Items.Add((taxRow(count)(k)).ToString())
> > >               Next
> > >        Next
> > >   End If
> >
> > to this:
> >
> >    If taxRow.Length > 1 Then
> >        Dim cnt As Integer
> >        For cnt = 0 To taxRow.Length - 1
> >           'I only need the second row out of the datarow
> >           cmbTest.Items.Add((taxRow(count)(2)).ToString())
> >        Next
> >    End If
> >
> > Thanks,
> >
> > Seth Rowe
> >
> >
> > samoore33 wrote:
> > > Duh, brainfart! I acquired this PC from a previous programmer, he had
> > > not updated to 1.1 Framework, could that be the problem. The form I am
> > > working with may have been written on the 2.0 Framework.
> > >
> > > myDataSet.ReadXML("this.xml")
> > >
> > > The dataset has three tables in it. I use the foundRows DataRow to get
> > > the id to match up the items in the third table.
> > >
> > > 'Used to searchthrough the dataset
> > >                     Dim t As DataTable
> > >                     t = myDataSet.Tables("State")
> > >                     Dim strExpr = "id = '" &
> > > returnItems.SubItems.Item(count).Text & "'"
> > >                     Dim foundRows() As DataRow
> > >                     'returns the datarows that were found in the search
> > >                     foundRows = t.Select(strExpr)
> > >
> > > Dim taxRow() As DataRow 'creates the tax row to be looped through to
> > > populate the combobox
> > >
> > >                     'Searches through the tax tabel of the dataset
> > >                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> > > '" & foundRows(0)(2) & "'")
> > >
> > >                     'Populates the combo box for updating purposes
> > >                     If taxRow.Length > 1 Then
> > >                         Dim cnt As Integer
> > >                         For cnt = 0 To taxRow.Length - 1
> > >                             Dim k As Integer
> > >                             For k = 2 To 2
> > >                                'I only need the second row out of the
> > > datarow
> > >
> > > cmbTest.Items.Add((taxRow(count)(k)).ToString())
> > >                             Next
> > >                         Next
> > >                     End If
> > >
> > >
> > >
> > >
> > > rowe_newsgroups wrote:
> > > > What's the code you're using to populate them?
> > > >
> > > > Thanks,
> > > >
> > > > Seth Rowe
> > > >
> > > > samoore33 wrote:
> > > > > I am trying to dynamically add items to a listbox or combobox. The
> > > > > items add to either, but when I look through those items, there is
> > > > > nothing there. If I choose an item, it shows up.
> > > > >
> > > > > Not sure why, but the items are not visible in the listbox or combobox
> > > > > until one of the items has been chosen. This of course is not good,
> > > > > since someone can not see the items they need to choose from.
> > > > >
> > > > > Any help would be appreciated.
> > > > >
> > > > > Scott Moore
>
>
Author
22 Sep 2006 2:48 AM
Easton
I would check to make sure the drawmode property of the combobox is set to
"Normal".

Show quoteHide quote
"samoore33" wrote:

> The event that calls this is when the user selects an item out of the
> listview. Code is below:
>
> Private Sub lsvTest_SelectedIndexChanged(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles lsvTest.SelectedIndexChanged
>
>         'Clears the items in the combbo box
>         cmbTest.Items.Clear()
>
>         Dim TaxData As CRTTaxDataSet = New CRTTaxDataSet
>
>         'Reads the xml into the dataset
>         myDataSet.ReadXml("this.xml")
>
>         'dim variables to be used
>         Dim returnItems As ListViewItem =
> Me.GetSelectedListViewItem(lsvTest.Items)
>         Dim item As String
>         Dim count As Integer
>
>         'loops through the item that has been selected to populate the
> text boxes
>         For count = 0 To returnItems.SubItems.Count - 1
>             Select Case count
>                 'Populates the corresponding textbox and old value
> textbox for comparison for updating
>             Case 1
>                     cboState.SelectedItem =
> returnItems.SubItems.Item(count).Text
>
>                     'Used to searchthrough the dataset
>                     Dim t As DataTable
>                     t = myDataSet.Tables("State")
>                     Dim strExpr = "id = '" &
> returnItems.SubItems.Item(count).Text & "'"
>                     Dim foundRows() As DataRow
>                     'returns the datarows that were found in the search
>                     foundRows = t.Select(strExpr)
>
>                     Dim taxRow() As DataRow 'creates the tax row to be
> looped through to populate the combobox
>
>                     'Searches through the tax tabel of the dataset
>                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> '" & foundRows(0)(2) & "'", "Value")
>
>                     'Populates the combo box for updating purposes
>                     Dim cnt As Integer
>                     For cnt = 0 To taxRow.Length - 1
>                         Dim k As Integer
>                         For k = 0 To 2
>                             If k = 2 Then
>
> cmbTest.Items.Add((taxRow(cnt)(k)).ToString())
>                             End If
>                         Next
>                     Next
>             End Select
>         Next
>
>         'Clears the dataset
>         myDataSet.Clear()
>
>     End Sub
>
> rowe_newsgroups wrote:
> > Well, nothing I see would make the combobox's contents "invisible."
> > Does a certain event fire this code? If you could, please post that
> > code too (everything from sub to end sub), I have a feeling you might
> > be calling this code in the wrong event. Also your below code shouldn't
> > need the inner for next loop - so you could change this:
> >
> > >   If taxRow.Length > 1 Then
> > >       Dim cnt As Integer
> > >       For cnt = 0 To taxRow.Length - 1
> > >           Dim k As Integer
> > >               For k = 2 To 2
> > >                  'I only need the second row out of the datarow
> > >                  cmbTest.Items.Add((taxRow(count)(k)).ToString())
> > >               Next
> > >        Next
> > >   End If
> >
> > to this:
> >
> >    If taxRow.Length > 1 Then
> >        Dim cnt As Integer
> >        For cnt = 0 To taxRow.Length - 1
> >           'I only need the second row out of the datarow
> >           cmbTest.Items.Add((taxRow(count)(2)).ToString())
> >        Next
> >    End If
> >
> > Thanks,
> >
> > Seth Rowe
> >
> >
> > samoore33 wrote:
> > > Duh, brainfart! I acquired this PC from a previous programmer, he had
> > > not updated to 1.1 Framework, could that be the problem. The form I am
> > > working with may have been written on the 2.0 Framework.
> > >
> > > myDataSet.ReadXML("this.xml")
> > >
> > > The dataset has three tables in it. I use the foundRows DataRow to get
> > > the id to match up the items in the third table.
> > >
> > > 'Used to searchthrough the dataset
> > >                     Dim t As DataTable
> > >                     t = myDataSet.Tables("State")
> > >                     Dim strExpr = "id = '" &
> > > returnItems.SubItems.Item(count).Text & "'"
> > >                     Dim foundRows() As DataRow
> > >                     'returns the datarows that were found in the search
> > >                     foundRows = t.Select(strExpr)
> > >
> > > Dim taxRow() As DataRow 'creates the tax row to be looped through to
> > > populate the combobox
> > >
> > >                     'Searches through the tax tabel of the dataset
> > >                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> > > '" & foundRows(0)(2) & "'")
> > >
> > >                     'Populates the combo box for updating purposes
> > >                     If taxRow.Length > 1 Then
> > >                         Dim cnt As Integer
> > >                         For cnt = 0 To taxRow.Length - 1
> > >                             Dim k As Integer
> > >                             For k = 2 To 2
> > >                                'I only need the second row out of the
> > > datarow
> > >
> > > cmbTest.Items.Add((taxRow(count)(k)).ToString())
> > >                             Next
> > >                         Next
> > >                     End If
> > >
> > >
> > >
> > >
> > > rowe_newsgroups wrote:
> > > > What's the code you're using to populate them?
> > > >
> > > > Thanks,
> > > >
> > > > Seth Rowe
> > > >
> > > > samoore33 wrote:
> > > > > I am trying to dynamically add items to a listbox or combobox. The
> > > > > items add to either, but when I look through those items, there is
> > > > > nothing there. If I choose an item, it shows up.
> > > > >
> > > > > Not sure why, but the items are not visible in the listbox or combobox
> > > > > until one of the items has been chosen. This of course is not good,
> > > > > since someone can not see the items they need to choose from.
> > > > >
> > > > > Any help would be appreciated.
> > > > >
> > > > > Scott Moore
>
>
Author
25 Sep 2006 1:37 PM
samoore33
Drawmod is set to Normal. I really think that it is a problem with the
..Net Framework. It works on other peoples computers, just not mine. I
appreciate the help.

Scott Moore

Easton wrote:
Show quoteHide quote
> I would check to make sure the drawmode property of the combobox is set to
> "Normal".
>
> "samoore33" wrote:
>
> > The event that calls this is when the user selects an item out of the
> > listview. Code is below:
> >
> > Private Sub lsvTest_SelectedIndexChanged(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) Handles lsvTest.SelectedIndexChanged
> >
> >         'Clears the items in the combbo box
> >         cmbTest.Items.Clear()
> >
> >         Dim TaxData As CRTTaxDataSet = New CRTTaxDataSet
> >
> >         'Reads the xml into the dataset
> >         myDataSet.ReadXml("this.xml")
> >
> >         'dim variables to be used
> >         Dim returnItems As ListViewItem =
> > Me.GetSelectedListViewItem(lsvTest.Items)
> >         Dim item As String
> >         Dim count As Integer
> >
> >         'loops through the item that has been selected to populate the
> > text boxes
> >         For count = 0 To returnItems.SubItems.Count - 1
> >             Select Case count
> >                 'Populates the corresponding textbox and old value
> > textbox for comparison for updating
> >             Case 1
> >                     cboState.SelectedItem =
> > returnItems.SubItems.Item(count).Text
> >
> >                     'Used to searchthrough the dataset
> >                     Dim t As DataTable
> >                     t = myDataSet.Tables("State")
> >                     Dim strExpr = "id = '" &
> > returnItems.SubItems.Item(count).Text & "'"
> >                     Dim foundRows() As DataRow
> >                     'returns the datarows that were found in the search
> >                     foundRows = t.Select(strExpr)
> >
> >                     Dim taxRow() As DataRow 'creates the tax row to be
> > looped through to populate the combobox
> >
> >                     'Searches through the tax tabel of the dataset
> >                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> > '" & foundRows(0)(2) & "'", "Value")
> >
> >                     'Populates the combo box for updating purposes
> >                     Dim cnt As Integer
> >                     For cnt = 0 To taxRow.Length - 1
> >                         Dim k As Integer
> >                         For k = 0 To 2
> >                             If k = 2 Then
> >
> > cmbTest.Items.Add((taxRow(cnt)(k)).ToString())
> >                             End If
> >                         Next
> >                     Next
> >             End Select
> >         Next
> >
> >         'Clears the dataset
> >         myDataSet.Clear()
> >
> >     End Sub
> >
> > rowe_newsgroups wrote:
> > > Well, nothing I see would make the combobox's contents "invisible."
> > > Does a certain event fire this code? If you could, please post that
> > > code too (everything from sub to end sub), I have a feeling you might
> > > be calling this code in the wrong event. Also your below code shouldn't
> > > need the inner for next loop - so you could change this:
> > >
> > > >   If taxRow.Length > 1 Then
> > > >       Dim cnt As Integer
> > > >       For cnt = 0 To taxRow.Length - 1
> > > >           Dim k As Integer
> > > >               For k = 2 To 2
> > > >                  'I only need the second row out of the datarow
> > > >                  cmbTest.Items.Add((taxRow(count)(k)).ToString())
> > > >               Next
> > > >        Next
> > > >   End If
> > >
> > > to this:
> > >
> > >    If taxRow.Length > 1 Then
> > >        Dim cnt As Integer
> > >        For cnt = 0 To taxRow.Length - 1
> > >           'I only need the second row out of the datarow
> > >           cmbTest.Items.Add((taxRow(count)(2)).ToString())
> > >        Next
> > >    End If
> > >
> > > Thanks,
> > >
> > > Seth Rowe
> > >
> > >
> > > samoore33 wrote:
> > > > Duh, brainfart! I acquired this PC from a previous programmer, he had
> > > > not updated to 1.1 Framework, could that be the problem. The form I am
> > > > working with may have been written on the 2.0 Framework.
> > > >
> > > > myDataSet.ReadXML("this.xml")
> > > >
> > > > The dataset has three tables in it. I use the foundRows DataRow to get
> > > > the id to match up the items in the third table.
> > > >
> > > > 'Used to searchthrough the dataset
> > > >                     Dim t As DataTable
> > > >                     t = myDataSet.Tables("State")
> > > >                     Dim strExpr = "id = '" &
> > > > returnItems.SubItems.Item(count).Text & "'"
> > > >                     Dim foundRows() As DataRow
> > > >                     'returns the datarows that were found in the search
> > > >                     foundRows = t.Select(strExpr)
> > > >
> > > > Dim taxRow() As DataRow 'creates the tax row to be looped through to
> > > > populate the combobox
> > > >
> > > >                     'Searches through the tax tabel of the dataset
> > > >                     taxRow = myDataSet.Tables("Tax").Select("Taxes_Id =
> > > > '" & foundRows(0)(2) & "'")
> > > >
> > > >                     'Populates the combo box for updating purposes
> > > >                     If taxRow.Length > 1 Then
> > > >                         Dim cnt As Integer
> > > >                         For cnt = 0 To taxRow.Length - 1
> > > >                             Dim k As Integer
> > > >                             For k = 2 To 2
> > > >                                'I only need the second row out of the
> > > > datarow
> > > >
> > > > cmbTest.Items.Add((taxRow(count)(k)).ToString())
> > > >                             Next
> > > >                         Next
> > > >                     End If
> > > >
> > > >
> > > >
> > > >
> > > > rowe_newsgroups wrote:
> > > > > What's the code you're using to populate them?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Seth Rowe
> > > > >
> > > > > samoore33 wrote:
> > > > > > I am trying to dynamically add items to a listbox or combobox. The
> > > > > > items add to either, but when I look through those items, there is
> > > > > > nothing there. If I choose an item, it shows up.
> > > > > >
> > > > > > Not sure why, but the items are not visible in the listbox or combobox
> > > > > > until one of the items has been chosen. This of course is not good,
> > > > > > since someone can not see the items they need to choose from.
> > > > > >
> > > > > > Any help would be appreciated.
> > > > > >
> > > > > > Scott Moore
> >
> >