Posted on 2006-06-20
What is the best way to search a datagrid?
I know of 2 ways:
Loop through the rows checking the values for the one that I am searching for,
Use a dataview.find method.
I would like to use a dataview method, but it requires that I sort the dataview. If I sort the dataview, won't it return the wrong row index of my search field. Ex:
If my datagrid lists appointments for a doctor and I am searching for patient number 3 which is 5th on the list. If I sort the dataview by patient number, won't that give me the wrong index compared to my datagrid. My datagrid is showing my appointments in order by appointment time. Another thing, what if I don't know the names of my columns at the time I am trying to search a dataview???????????????
Any help is appreciated,