0

Hello Guys

I am trying to built a small application where i have a grid view on update panel, along with a dropdown list which shows the list of all columns of my table, and a text box to filter values.

When a user selects a value in dropdownlist (ex: Firstname).
and enters john in textbox i want to update the grid view , where the first names are john.

i am able to show the data in grid view and also able to see my columns name in ddl, but after that i am sure what to do.

Can some body please help me..

Thanks

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jseger
0

Use the Filter on your binding source.

Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

        Try
            DataGridViewForm.YourBindingSource.Filter = String.Format("{0} = '{1}'", _
DataGridViewForm.YourDataSet.YourTable.Columns(columnIndex).ColumnName.ToString, TextBox1.Text)
        Catch
            MessageBox.Show("Database error")
        End Try
        Me.Close()
    End Sub

Check out My Code Project.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.