Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2007, 05:58 AM
Registered User
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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)?






Similar Threads
Thread Thread Starter Forum Replies Last Post
DatagridViewAutofilter column manavi C# 1 November 3rd, 2006 03:39 PM
DatagridViewAutofilter column manavi .NET Framework 2.0 0 October 26th, 2006 01:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.