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.
Jump to Post
I 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"
All 6 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.