Wrox Programmer Forums
|
Visual Studio 2008 For discussing Visual Studio 2008. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2008 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, 2009, 03:24 AM
Authorized User
 
Join Date: Jul 2009
Posts: 30
Thanks: 10
Thanked 0 Times in 0 Posts
Question Combobox list filter

Hi All

I have a datagridview on Form1 to filter my columns I have a combobox with a list of my columns if I select one column header in the combobox I can then enter the name in a textbox and the filter works how can I change my code to be able to filter more columns

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Me.NHEBindingSource.Filter = String.Format("{0} like '%{1}%'", Me.New_HomeDataSet.NHE.EMPLOYEE_NAMEColumn.ColumnName, Me.TextBox1.Text)

        Catch ex As Exception
            MsgBox("ERROR")
        End Try

End Sub
 
Old December 21st, 2009, 11:16 AM
Authorized User
 
Join Date: Jul 2009
Posts: 30
Thanks: 10
Thanked 0 Times in 0 Posts
Unhappy Combobox list filter

Please can someone help with this ?

I need to be able to select more than one column
Code:
Me.NHEBindingSource.Filter = String.Format("{0} like '%{1}%'", Me.New_HomeDataSet.NHE.EMPLOYEE_GRADEColumn, Me.TextBox1.Text)

        If Nothing Then

        Else
            Me.NHEBindingSource.Filter = String.Format("{0} like '%{1}%'", Me.New_HomeDataSet.NHE.EMPLOYEE_NAMEColumn, Me.TextBox1.Text)
        End If


        
    End Sub
Why so little help on this site





Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox List Nightmare jippyuk Access VBA 1 June 19th, 2009 11:37 AM
List Box Refresh When Invoking Filter RodM Access VBA 0 January 4th, 2009 09:54 AM
"Are you Sure" Before Dropping List in ComboBox lam2rw Excel VBA 2 September 22nd, 2006 06:57 AM
Dynamic Combobox List Intern06 Pro VB Databases 2 June 29th, 2006 09:41 AM
Combobox that shows what's not in its list Mitch Access 6 September 18th, 2003 11:00 AM





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