RTC Forums

Subscription => Support => Topic started by: classic12 on November 22, 2011, 11:35:41 PM



Title: Move to data set record
Post by: classic12 on November 22, 2011, 11:35:41 PM
iOS app

I can use a next / prev button to step through the data set And get the populated strong grid's index to follow. I now need to do the reverse. 


I have a string grid that populates with data from mydataset

I am trying to set the row index on the data set to match the selected index in the string grid. Ie as the grid scrolls or a row is selected in the string grid all the data in the edits are moved accordingly. 


Title: Re: Move to data set record
Post by: D.Tkalcec (RTC) on November 23, 2011, 12:03:18 AM
I'm not entirely sure what you mean, but if you are asking how to move directly to a specific row inside a TRtcDataSet without using First/Prior/Next/Last, the answer is to use the "Row" property (zero-indexed, just like RTC arrays, so the first row is actually 0 and not 1).

To check the current row number in a TRtcDatSet, simply read its "Row" property (first record is on Row=0, last record is on Row=RecordCount-1).

To move to a specific row number in a TRtcDataSet, set the its "Row" property to the record number (also using 0 as the first record and so forth).

Best Regards,
Danijel Tkalcec