I am using Delphi 2007 and the TcxGrid to show the contents of a file library. The database houses information about the type of file, name, path, and extension.
In testing I am loading 1700 records into the grid through the TDataSet. I also make room in the grid for 3 more fields which need yet to be calculated. They are if the files exists, size of the file, and date modified.
My goal is to show the user all of the information that's stored (which works great and is fast) then in a background thread find the information for the other three fields of data and then insert them into the TcxGrid. This question has little if nothing to do with the threading I am doing. Its working fine.
My problem is that accessing the fields in the grid that is already constructed has a huge slowdown when I access it. I have tried two different ways ...
Grid.DataController.Values[RecordIndex,FieldIndex] - but this is a variant and I suspect that is why it is so slow
Grid.DataController.DataSet.FindFirst Grid.DataController.DataSet.FindNext Grid.DataController.DataSet.Fields[FieldIndex] But using this "seek" method is just as slow as the first method I tried. Locate and moveby are slow as well.
So long question short, What is the fastest way to access a record?
The updating code needed to be within a begin/end update was my big problem.
Thank you Lieven for your comment as it was the solution to my problem. And thank you Gad and Daniel for responses which I learned from.
This would have been more apparent to everyone had I more time yesterday to post some code.