Error MCCB

1 posts, 0 answers
  1. Hengky
    Hengky avatar
    67 posts
    Member since:
    Sep 2015

    Posted 17 Feb 2016 Link to this post

    Hello All...

    I need help about MCCB...

    Why the data always change to blank after i click new button or edit button 

    hope attached picture help to explain the problem 

     Here the code i write on Form_load 

    ds = New DataSet("Daftar")
            Tblanggota = ds.Tables.Add("Anggota")
            With Tblanggota
                .Columns.Add("KODE", GetType(String))
                .Columns.Add("NAMA", GetType(String))
            End With
            'fill TblAnggota
            Using conn As New OleDbConnection(str)
                Using cmd = conn.CreateCommand()
                    'mengisikan data Anggota.
                    Dim query = <sql>
                                     SELECT KodeAnggota as KODE, NamaAnggota as NAMA FROM MstAnggota ORDER BY KodeAnggota
                    cmd.CommandText = query
                    Dim adapter = New OleDbDataAdapter(cmd)
                    adapter.SelectCommand = cmd
                    Tblanggota.Rows.Add(New Object() {"", ""})
                End Using
                With CmbAnggota
                    .DataSource = Tblanggota
                    '.SelectedValue = ""
                    .AutoSizeDropDownToBestFit = True
                    .AutoFilter = True
                    .DisplayMember = "KODE"
                    .ValueMember = "KODE"
                    .Text = ""
                    TxtNamaAnggota.Text = ""
                    'Dim filter As New FilterDescriptor()
                    'filter.PropertyName = Me.CmbAnggota.DisplayMember
                    'filter.[Operator] = FilterOperator.Contains
                    'CmbAnggota.MultiColumnComboBoxElement.EditorControl.EnableCustomFiltering = True
                    'AddHandler CmbAnggota.MultiColumnComboBoxElement.EditorControl.CustomFiltering, AddressOf CmbAnggota_CustomFiltering
                    'AddHandler CmbAnggota.KeyDown, AddressOf CmbAnggota_KeyDown
                End With
            End Using
            TxtNamaAnggota.DataBindings.Add("Text", Tblanggota, "NAMA")

    I have tried to move the code on button_click event. but the i got the same result.


    Thanks before

Back to Top