Click to See Complete Forum and Search --> : DataGrid


Raptors Fan
September 10th, 2001, 04:04 PM
Hi,

I have an ADO recordset with a datagrid. Now, everytime I go through the recordset, this is shown visibly on the datagrid.

Thus, when I print the records in the recordset or perform a search to the recordset, the datagrid scrolls from the first record to the last or until it finds the record being searched.

This process is very slow. Is there a way to go through the records in the recordset without the datagrid scrolling and still have the datagrid associated with the recordset. I do not need to see all the scrolling when printing or searching.

Thanks,

RF

Cimperiali
September 11th, 2001, 01:57 AM
'You may use LockWindowUpdate api to lock the graphic update of current window :
'from Api-guide
private Declare Function LockWindowUpdate Lib "user32" (byval hwndLock as Long) as Long
'The LockWindowUpdate function disables drawing in the given window.
'Only one window can be locked at a time.
'Requires Windows NT 3.1 or later; Requires Windows 95 or later
'lock the window update
dim ret as long
ret =LockWindowUpdate(me.hwnd)
'your code to search for data
'...
'remember to Unlock windowupdate after finishing the search
if ret <> 0 then
LockWindowUpdate false
end if




Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater