Locating in DataGrid

  • Thread starter Thread starter Povalyaev Sergey
  • Start date Start date
P

Povalyaev Sergey

Hello all!

I have a DataGrid bound to a DataTable. I need to select a record in the
DataGrid that correspond to a DataRow with specified field "ID" value, but
DataGrid should be sorted by "Name" value.

As far as I see, there are no way to do this in performance sensitive way.

I have to locate a record in the DataView that is sorted by "Name". I cannot
do this via "Find" method, because I have a lot of records with same "Name".
I cannot do this via "Item" property, because DataTable has no way to
acquire index of a record in the DataTable for specified "ID".

Am I wrong and there is some way of perfoming this simple task. I have
worked with Delphi and FoxPro and this is always be very simple.

Thanks in advance!
Sergey Povalyaev.
 
Hi, Cor!

Not exactly. I have ID and I can find DataRow via DataView sorted by "ID",
but then I want to select this row in DataGrid, that is sorted according to
"Name" field, and to do this I should set CurrentMannager.Position to the
position in the DataView that is sorted by "Name", not "ID". But this second
DataView hasn't methods to find neither for "ID" nor for DataRow, in this
case Find method will search only by "Name". Umph... :(
 
Sergey,

Did you really try it?

Cor

Povalyaev Sergey said:
Hi, Cor!

Not exactly. I have ID and I can find DataRow via DataView sorted by "ID",
but then I want to select this row in DataGrid, that is sorted according
to
"Name" field, and to do this I should set CurrentMannager.Position to the
position in the DataView that is sorted by "Name", not "ID". But this
second
DataView hasn't methods to find neither for "ID" nor for DataRow, in this
case Find method will search only by "Name". Umph... :(
 
Back
Top