J
John Hernry
I have been watching the dotnet newsgroups for a couple of weeks now and
scouring the net looking for a solution to my datagrid find functionality.
With no luck. I am hoping that you can help me.
I am an old VB6 coder used to using Sheridan controls, and I am just
starting to learn the .net world.
I am upgrading my music catalogue database, where the data is stored in an
Access mdb file.
The datagrid is bound to a dataview and I can get the find to work in that
it returns a valid row, but it is not the first row with that value.
Here is my search code
Dim dvData As DataView
Dim cmBkMrk As CurrencyManager
Dim intRec As Integer
dvData = Me.dgrCatalogue.DataSource
dvData.Sort = "Artist"
cmBkMrk = Me.dgrCatalogue.BindingContext(dvData)
intRec = dvData.Find("Triumph")
cmBkMrk.Position = intRec
It is finding the band Triumph, and moving to the found row, but it is not
the first row with the value Triumph. Why?
While I am here, I have three more questions:
1) How do I perform a FindNext?
2) How do I perform wildcard searches?
3) How do I perform searches on more than one column? I have figured out
how to sort on two columns, but what is the dvData.Find code?
Thanks In Advance!
Greg
scouring the net looking for a solution to my datagrid find functionality.
With no luck. I am hoping that you can help me.
I am an old VB6 coder used to using Sheridan controls, and I am just
starting to learn the .net world.
I am upgrading my music catalogue database, where the data is stored in an
Access mdb file.
The datagrid is bound to a dataview and I can get the find to work in that
it returns a valid row, but it is not the first row with that value.
Here is my search code
Dim dvData As DataView
Dim cmBkMrk As CurrencyManager
Dim intRec As Integer
dvData = Me.dgrCatalogue.DataSource
dvData.Sort = "Artist"
cmBkMrk = Me.dgrCatalogue.BindingContext(dvData)
intRec = dvData.Find("Triumph")
cmBkMrk.Position = intRec
It is finding the band Triumph, and moving to the found row, but it is not
the first row with the value Triumph. Why?
While I am here, I have three more questions:
1) How do I perform a FindNext?
2) How do I perform wildcard searches?
3) How do I perform searches on more than one column? I have figured out
how to sort on two columns, but what is the dvData.Find code?
Thanks In Advance!
Greg