dataview find?

G

Guest

i've created a search function, using vc#, and i'm using the dataview.find()
method to get the index of the found record. the problem is that there are
many similar names. it always returns the same index, but it can be any one
of the items. as an example, if i type in the work "bolt" it will return the
index 1201, the first "bolt" is at 1120 and the last one is at 1294. it is
for a point of sale program and i have no control over the part titles. it
sorts them in alpha order and i need it to point to the first "bolt" in the
dataview (which is bound to the datagrid). i've also tried using the
dataview.findrows() method but can not find a way to get the index from the
rows. if i could get the index from the findrows() then i could just point
the CM to it. is there anyway to get that index?

thanx in advance.
 
G

Guest

have to .Sort before .find or .findrows will work. it sorts them in the
right alpha order, but just does not go to the first instance of my search
criteria.
 
V

vMike

oscar said:
i've created a search function, using vc#, and i'm using the dataview.find()
method to get the index of the found record. the problem is that there are
many similar names. it always returns the same index, but it can be any one
of the items. as an example, if i type in the work "bolt" it will return the
index 1201, the first "bolt" is at 1120 and the last one is at 1294. it is
for a point of sale program and i have no control over the part titles. it
sorts them in alpha order and i need it to point to the first "bolt" in the
dataview (which is bound to the datagrid). i've also tried using the
dataview.findrows() method but can not find a way to get the index from the
rows. if i could get the index from the findrows() then i could just point
the CM to it. is there anyway to get that index?

thanx in advance.

have you tried something like dataview.rowfilter = "PartsName = '*'bolt'*"
It should return all rows with bolt and then you can .sort it and get the
first record? If the list doesn't sort properly you may need to add a column
in code to the datatable which has information needed to sort the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top