Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have a datagrid whose Datasource query is nothing but display 3 columns.
First column is checkbox column to select Table
Second column is Table Name
Third Column is display all column of the table comma separated.

User select Table which he wanna update.
Since there are lot of Table in a DB he has to scroll. so I wanna to add Filter to it.
But when he filter and checks a Table and filter another Table then laready check row should not get Lost.

How to achieve it.

What I have tried:

Dim source1 As New BindingSource()

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
source1.Filter = "[Table Name] = '" & TextBox1.Text & "'"
dgvTableSelection.Refresh()
Catch ex As Exception
MsgBox(Convert.ToString(ex.Message))
End Try
End Sub

For Binding DATAGRID
Try
Dim view1 As New DataView(ds.Tables(0))
source1.DataSource = view1
dgvTableSelection.DataSource = view1
dgvTableSelection.Refresh()
dtNormal = ds.Tables(0).Copy()
Catch ex As Exception
MsgBox(Convert.ToString(ex.Message))
End Try
Posted

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