Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15136

Combobox selectedchange

$
0
0
Hi,

My combobox has 4 values as dropdownlist

ALL
Firstname
Lastname
NationalID


Now, if for example, the user selected firstname and entered text on TxtSearch the datagridview is populated accordingly.

However, when the user option to select ALL I want the datagridview to be refreshed, i.e., with all the records displayed.

The below code doesn't do it - please any help!



Code:

Private Sub cmbSearch_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbSearch.SelectedIndexChanged

        Dim cmd As New SqlCommand
        Dim conn As SqlConnection = GetDbConnection()

        TxtSearch.Clear()

        If cmbSearch.SelectedValue = "ALL" Then

        Me.TbltenantsTableAdapter.Fill(Me.Dstenantdetails.tbltenants)
        PTUpdate.Visible = False

        End If
    End Sub

Thanks

Viewing all articles
Browse latest Browse all 15136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>