Results 1 to 6 of 6

Thread: Combobox issues

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Location
    Belgium
    Posts
    154

    Combobox issues

    Hi, I am making a project to see al my dvd's plus their information in a windows form with ado.net.

    Now I've made a form that has the design like the picture "design.jpg". On this picture you can also see the datasources and tables I use.

    The structure of my dataset is like on this picture: "dataset.jpg"

    This is my code:
    code Code:
    1. Public Class frmDVDcollectie
    2.  
    3.     Private Sub frmDVDcollectie_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4.         'TODO: This line of code loads data into the 'DtsMuziekcollectie.tblCategorieen' table. You can move, or remove it, as needed.
    5.         Me.objTblCategorieenTableAdapter.Fill(Me.objDtsMuziekcollectie.tblCategorieen)
    6.         'TODO: This line of code loads data into the 'DtsMuziekcollectie.tblDVDInhoud' table. You can move, or remove it, as needed.
    7.         Me.objTblDVDInhoudTableAdapter.Fill(Me.objDtsMuziekcollectie.tblDVDInhoud)
    8.  
    9.         Vullen()
    10.  
    11.     End Sub
    12.  
    13.     Private Sub Vullen()
    14.         Dim dtvDVDInhoud As DataView
    15.  
    16.         dtvDVDInhoud = objDtsMuziekcollectie.tblDVDInhoud.DefaultView
    17.         dtvDVDInhoud.RowFilter = "CategorieID = " & cboCategorie.SelectedValue.ToString
    18.         dtvDVDInhoud.Sort = "DvdID ASC"
    19.  
    20.         objTblDVDInhoudBindingSource.DataSource = dtvDVDInhoud
    21.         Me.objTblDVDInhoudBindingSource.MoveFirst()
    22.  
    23.  
    24.     End Sub
    25.  
    26.     Private Sub cboCategorie_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboCategorie.SelectedIndexChanged
    27.         If Not cboCategorie.SelectedValue Is Nothing Then
    28.             Vullen()
    29.         End If
    30.     End Sub
    31.  
    32.     Private Sub btnVorige_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVorige.Click
    33.         Me.objTblDVDInhoudBindingSource.MovePrevious()
    34.     End Sub
    35.  
    36.     Private Sub btnVolgende_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVolgende.Click
    37.         Me.objTblDVDInhoudBindingSource.MoveNext()
    38.     End Sub
    39.  
    40.     Private Sub btnEerste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEerste.Click
    41.         Me.objTblDVDInhoudBindingSource.MoveFirst()
    42.     End Sub
    43.  
    44.     Private Sub btnLaatste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLaatste.Click
    45.         Me.objTblDVDInhoudBindingSource.MoveLast()
    46.     End Sub
    47.  
    48. End Class

    The problem I have is that when I compile the project that I can perfectly change the categoriebut when I have changed the categorie, the I've selected is there twice and the categorie that is one step above the one I've selected is gone. How can I make sure that all my categories keep standing their on there place?

    Greetings
    Hash
    Attached Images Attached Images   

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width