Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Imports System.Data.OleDb



Public Class DisplayList

    Private Sub DisplayList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'SongDataSet.MAS_SONGS' table. You can move, or remove it, as needed.
        Me.MAS_SONGSTableAdapter.Fill(Me.SongDataSet.MAS_SONGS)

        Refresh()



    End Sub


    Private Sub DataGridView1_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentDoubleClick
        Dim Form As New SongShow

        Form.RichTextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString()
        Form.RichTextBox1.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString()
        Form.RichTextBox1.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString()
        Form.RichTextBox1.Text = DataGridView1.CurrentRow.Cells(3).Value.ToString()

        Form.ShowDialog()
    End Sub

    Private Sub DisplayList_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown

        If e.KeyCode = Keys.Escape Then
            TextBox4.Clear()

        Else

            e.Handled = True

        End If
    End Sub

    
    Private Sub FillByToolStripButton_Click(sender As Object, e As EventArgs) Handles FillByToolStripButton.Click
        Try
            Me.MAS_SONGSTableAdapter.FillBy(Me.SongDataSet.MAS_SONGS, SM_EDESCToolStripTextBox.Text)
        Catch ex As System.Exception
            System.Windows.Forms.MessageBox.Show(ex.Message)
        End Try

    End Sub

    Private Sub TextBox4_TextChanged(sender As Object, e As EventArgs) Handles TextBox4.TextChanged

        Me.MAS_SONGSTableAdapter.FillBy(Me.SongDataSet.MAS_SONGS, TextBox4.Text)
        'We need search by query like to view any results contain  part of value

    End Sub

    Private Sub MASSONGSBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles MASSONGSBindingSource.AddingNew
        MAS_SONGSTableAdapter.Update(SongDataSet)
    End Sub

    Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

        DataGridView1.Update()
        DataGridView1.Refresh()
    End Sub

End Class


What I have tried:

i have added new record through ms access database but after i updated my form not showed or refresh new record ....
Posted
Updated 13-Oct-19 6:28am

1 solution

Call Invalidate on it: Control.Invalidate Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900