Re: Locating a Datagrid Row from the Datasource Row, FAST



You just want to find if the row is there and/or display the data? Try a
DataView and set a RowFilter on it.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"Ty" <tylershome@xxxxxxxxx> wrote in message
news:cf9f705e-eb9b-4dfc-9fb3-9eb2108d4bd5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all

Short version of my problem:
i have a Datagrid (Flexgrid from ComponentOne) with a Datatable as
source. I need to search a row in the datatable, using a primary key
column in the datatable, and then figure out wich row this currently
is in the Datagrid. This should probably be done using the currency
manager for speed reasons.

For the live of me, i can't figure out how to locate the row very fast
in the Datagrid. Everybody is just talking about finding a record in
the datatable corresponding to a row on the datagrid, so the other way
arround.


Some explanations:
Speed is a primary concern. This Datagrid is very dynamic. It can
contain several thousand records (worst case) and several 100 updates
or even 1000 updates a second can trickle in. Those updates need to be
visualized with colors on the grid. The amount of records in the grid
can change very often. also, the user can sort the 2 douzen or so
columns.

Simply scanning thru the grid (using Search function of the grid),
searching for the right key is no option because only about 50 records/
sec can be located like this.

The only solution i have right now is filling a Hashtable with Key and
Datagrid RowID every time the amount of records in the grid change or
the user changes sorting. Then using the Hashtable to locate the row.
About 30000 rows a second can be located like this. Fast enough. But
it's not very elegant and error prone. And it's possible that changes
on the grid happen very often, negating the speed advantage of the
Hashtable.

I found out, that locating a record on the Datatable is just as fast
as in Hashtable, 30000recs/s (in a 5000recs Datatable). Also, if i
change some cell/col value in the Datatable, this change is immediatly
shown in the grid, no matter how the grid is sorted. Locating and
changing a value can be done almost 20000 times a second. Hence, there
IS a way to locate the row in the grid very fast. probably using
currency manager.


It would be great if someone could help me. Thanks for any hints!

Greets

Beat


.



Relevant Pages

  • Re: SQLCeResultSet does not update first row
    ... the DataSet for a bound datagrid. ... Ginny Caughey wrote: ... result set in the grid, but it's still the same principle. ... int recs = sqlCeCommand.ExecuteNonQuery; ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to use one datagrid to update/insert into another
    ... dsMassUpdate is your actual dataset that is going to be updated? ... dgMassUpdate is a datagrid that shows the dataset dsMassUpdate? ... Is dbMassUpdate your data grid that you are inserting their ... Dim cmdParam As SqlParameter ...
    (microsoft.public.dotnet.languages.vb)
  • Locating a Datagrid Row from the Datasource Row, FAST
    ... i have a Datagrid with a Datatable as ... or even 1000 updates a second can trickle in. ... visualized with colors on the grid. ... the user changes sorting. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQLCeResultSet does not update first row
    ... Although SqlCeResultSet is a DataReader and inherits from SqlCeDataReader, ... datagrid refreshed its view with "X's". ... Ginny Caughey wrote: ... result set in the grid, but it's still the same principle. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Datatable interer Original-Index beim Sortieren
    ... Einen Puffer für die Daten benötigst du immer, ... Objekt nun als "Unter"-Objekt im Grid enthalten ist oder über einen Verweis ... > Grid z.b. dem Datagrid passieren. ... dann musst du den Sort-Algorithmus schon an deine Belange anpassen. ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)