Record Index in a Dataset when the PK is Known

  • Thread starter Thread starter a
  • Start date Start date
A

a

Hello,

After having a nightmare of a time binding to a DataView, I decided to
revert back to binding to a dataset. I need a way to navigate, so the
'Record Selection' form is a ListView (sortable) in details view. I cannot
use the index of the listview.

I need to set the position of the currency manager to the 'Index of the
Selected ID'. Knowing the PK of a row in a dataset, how can I best find its
index?

Kevin
 
Hi Kevin,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the index of a certain
row by the primary key. If there is any misunderstanding, please feel free
to let me know.

As far as I know, we can only get the reference to a DataRow by the Select
method or FindByID method. So I think we have to go through the row
collection and check for index. Then set CurrencyManager.Position to that
index.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top