|
-
Feb 25th, 2003, 12:12 PM
#1
Thread Starter
Lively Member
Finding The Current Reocrd
I have seen some messages related to this issue, but none quite answers my question. Maybe I'm applying old ways of thinking to new ways of doing things???
I have a disconnected dataset, and I display each record, one at a time, full screen. I have a public counter (wish there was a better way) so I can start by showing the first record (rows collection index 0),and then press Next and Previous to move around. Each press checks for beginning and end of record set and if in bounds, adds or subtracts one from the publc counter and displays the record.
Now, If i want to Find a record I use the find method and it returns a Row Object. I could display the row object, but I don't really know its record number (current index in the collection) so I can't reset my public counter to allow users to later press Next and Previous again.
So how do you determine the index of a row in the Rows collection?
-
Feb 25th, 2003, 12:46 PM
#2
Frenzied Member
You can bind the dataset to the buttons, to move forward and backward. I'll post some code later.
Dont gain the world and lose your soul
-
Feb 25th, 2003, 06:13 PM
#3
Thread Starter
Lively Member
I was able to use your suggestion and figure out how to bind the data to the text boxes and move throught the data with the Next/Prev buttons also bound to the data. But now fI cant igure out how to do a Find, which is the reverse of where I started.
If the user presses the Find button I can prompt for a customer ID whcih is the key field. The Find method of Rows returns a row object. Like this:
Dim rowFoundRow As DataRow = DsCustomer1.Tables(0).Rows.Find(newID)
But I need to set the binding.Position to some number that relates to this found row. How do I do this?
In other words I need to know what row number the found row is in the data set.
Last edited by ggprogram; Feb 26th, 2003 at 02:11 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|