[quoted text, click to view] Jeffrey Tan[MSFT] wrote:
> Hi James,
>
> Thanks for your posting!
>
> Based on my understanding, you want to implement the search function in
> your ADO.net application, your issue is how to implement the "Find Next"
> feature in your app. If I misunderstand you, please feel free to tell me.
>
> After setting RowFilter property for dataview, the dataview will contain
> the filtered child view with the filter condition. So we may Sort property
> to sort the filtered view, and just return the first DataRowView for the
> first search. Then we may store an static index and the dataview of the
> filtered view. For the "Search Next" request, we may just add 1 to the
> static index and return the next item(DataRowView) in the stored dataview.
> All will work well.
>
> Hope this helps.
> =================================
> Thank you for your patience and cooperation. If you have any questions or
> concerns, please feel free to post it in the group. I am standing by to be
> of assistance.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! -
www.microsoft.com/security > This posting is provided "as is" with no warranties and confers no rights.
>
I'm not sure I explained that well. I'll try again.
I have a form that is the result of the Data Form Wizard. This creates
the usual CRUD buttons and buttons to navigate the dataset.
On the form I have put another textbox which users can enter a partial
search and click find.
I have implemented a sort and filter using a dataview based on the bound
dataset. This finds the record ok.
EG
DataView dv = objdsTransport.Tables[0].DefaultView;
dv.RowFilter = "TransportCo like '" + txtSearch.Text + "*'";
So I have this dataview how do I now position objdsTransport so that it
goes to the appropriate position.
I thought I could go
string strCoName = dv[0].Row[0].ToString();
objdsTransport.Tables[0].Rows.Find("TransportCo = '" + strCoName + '";
this also works but it returns a datarowcollection which is no good to
me, because I want to position the dataset to the record like seek used
to do under ADO.
I am guessing I have to use bindingcontext.postion or something like
that but cant seem to work it out.