all groups > dotnet windows forms databinding > december 2005 >
You're in the

dotnet windows forms databinding

group:

bindingsource.filter question


bindingsource.filter question Shannon Ramirez
12/20/2005 9:21:53 AM
dotnet windows forms databinding:
I'm uisng a custom class to fuel my datasouce. I've draged the datasource
over in detail view and put in the

Me.CampersBindingSource.DataSource = oCampers



the data appears fine. now what I'm trying to figure out is how to wire the
textbox in the binding navigor toolstrip so that when I type something in, i
can get it to search through a "column" in my dataset and bring up that
info. can i have it search several columns??



Per Bart's suggestion.. i'm using this in my camper class

Public Class Campers

Inherits System.ComponentModel.BindingList(Of Camper)

to help out.. lets say i'm trying to filter on the property "LastName"



I tried

Private Sub ToolStripTextBox1_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ToolStripTextBox1.TextChanged

Me.CampersBindingSource.Filter = "LastName='Smith'"

End Sub

no luck



thanks for any help

shannon



Re: bindingsource.filter question Colin Robinson
1/1/2006 11:58:12 AM
Try something like a movefirst or databind method to refresh the form view






[quoted text, click to view]

Re: bindingsource.filter question Colin Robinson
1/1/2006 12:27:48 PM
try this:
Me.PaymentPlanBindingSource.RemoveFilter()
If Not Me.ToolStripTextBox1.Text Is Nothing Then

Me.PaymentPlanBindingSource.Filter = "planame Like " & "'*" &
Me.ToolStripTextBox1.Text & "*'"

Me.PaymentPlanBindingSource.MoveFirst()

End If





[quoted text, click to view]

AddThis Social Bookmark Button