CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: DataGrid

  1. #1
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    78

    DataGrid

    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


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: DataGrid


    '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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured