Hi, using VB 2008, I have a datagridview bound to a datasource and want to position to a row based on the value keyed by the user in a textbox. I can sort of accomplish this with one line of code on the textbox changed event i.e.:
Me.BindingSource.Position = Me.BindingSource.Find("ColumnName", TextBox1.Text)
which works great when the user keys in an exact match. Question is, how do I position to a partial match, i.e. the first match found, i.e. "ABC " might position to "ABCDEFG" if it is the first record alphabetically. I can't seem to find a decent example of how to do this.
Thanks,
Bill P.
Bill Purkins
0
Light Poster
Recommended Answers
Jump to PostI worked on something like this a little while ago, we used the filter & sort propery to narrow down the list.
Me.BindingSource.Filter = "Column LIKE '" & Textbox.Text & "&'" And Me.BindingSource.Sort = "Column Desc"
Jump to PostI think it's
Me.BindingSource.Filter = "Column LIKE '%" & Textbox.Text & "%'"
All 6 Replies
RipperJT
2
Newbie Poster
asnider
2
Newbie Poster
RipperJT
2
Newbie Poster
asnider
2
Newbie Poster
Bill Purkins
0
Light Poster
Bill Purkins
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.