DataGridviewAutoFilter
I have a datagridview that I'm populating from contents from a database. Working great. I have code like this:
Dim bind As BindingSource = New BindingSource()
Dim table As DataTable()
datagrid.DataSource = bind
Dim connection As New OleDbConnection(<DSN>)
Dim data As New OleDbDataAdapter("<sql statement>")
data.Fill (table)
bind.DataSource = table
I offer up the ability for the user to alter the columns they would like to see - and then I adjust the <sql statement> accordingly. All working great. My users want an excel autofilter like capability and I ran across the DataGridviewAutoFilter on the MSDN. Great. Here is the rub - I can only get the DataGridViewAutoFilter to work - if I in design mode - preset the column and their types. How can I get all columns to be of type DataGridViewAutoFilter - while I change the data to show on the fly ((programmatically)?
|