Simple search screen...

  • Thread starter Thread starter José Araujo
  • Start date Start date
J

José Araujo

Hi,

I am trying to create a screen that has:

1. A grid with data.
2. A button to search for a particular data in the grid.


I can use the dataview.find to get the line where the data that i am looking
for is located. However, to do so i need to sort the view by the same fields
that i am trying to search in.

I don't want to that... i want to have a grid with the customer sorted by
ID, and to be able to search by name, and to change the position of the grid
to the row that i found using the find method.

I have been trying to figure out a way of doing this... but i haven't been
able...

Thanks a lot for your help, José Araujo
 
Since you don't want to use Find...I'd recommend a DataView. you can also
use DataTable.Select, but I'm not sure if that's what you are after.

You can use a DataView and bind the grid to that. Then, when the user hits
your button you can get a value. Then, dataView.Rowfilter =
"myColumn= '" & someValue & "'"

Now, you may want to give them a change to do it on multiple fields, in
which case you'd just adjust the myColumn and the value.

If the grid is bound to the view instead, as soon as the Rowfilter is set,
you'll show only what you want.

HTH,

Bill
 
Thanks for your answer.

However, that is not what i want to do.

I want to move the current record in edition from the grid to the found
record

Suppose that you have a grid:

CustomerID Name
1 José **** HERE IS THE FOCUS
2 Will
3 Richard


Then i want the user to be able to press my button, enter 'Richard' and to
move the focus to the third line... not to disappear all the lines except
that... but just to move the focus...

Do you know what i mean? Thanks, José.
 
Man, I have been looking for a way to do this as well, that does not rely on reading through the BindingContext postitions one at a time...
Anyone?
This is a major oversight in the framework, IMO...
 
Back
Top