Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Periodic refresh of a grid that uses virtual scrolling Collapse All
Subject Author Date
Nam Huy Aug 10, 2009 - 1:08 PM

Hi,


I’m trying to create a virtual grid with the virtual scrolling mode enable where:


- a cell background color will flash when its contents displayed a specific string value;


OR/AND


- the cell string value is replaced with a bitmap


The data that drive these is dynamic.


 


I looked at the AdoRecorsetView project. But it does not give examples when the virtual scrolling mode is enable for the following:


- edition of cells that are  visible on the virtual grid


- refresh specific cells when its data from the data provider changed


- programmatically navigate through the visible cell to change its contents (ie getRow, get Column in virtual scrolling mode)


Your help would be greatly appreciated! Thanks!

Technical Support Aug 11, 2009 - 3:06 AM

Here is the editable version of the AdoRecordsetView sample application:

http://www.prof-uis.com/download/forums/AdoRecordsetEdit.zip

But you may need to code a specific version of the end-of-edit handling for particular editing tasks.

The CExtGridWnd::GridCellRectsGet() method computes grid cell rectangles for displayed grid cells. The computed rectangles are based on the client coordinate system of the grid window. You can simply invalidate modified grid cells. That’s how you should update the externally changed data. Of course you may need to re-load externally modified grid cells. The virtually cached grids allow to access only displayed grid cells via the CExtGridWnd::GridCellGet() method invocation. The CExtScrollItemWnd::OnSiwGetVisibleRange() virtual method returns a CRect object which contains indices of top and bottom displayed/cached rows in the CRect::top and CRect::bottom properties.

The grid cell flashing can be implemented using timers running in your CExtGridWnd-based window. The timer handler should simply change grid cell text/background color and invalidate changed grid cells.