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 » CExtGridWnd in virtual mode Collapse All
Subject Author Date
Bart Kampers Jun 17, 2010 - 5:49 AM


<table style="border-collapse: collapse; border-top: #d5d5d5 1px solid" id="MessagesTable" border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" colspan="3">



 Hello,


 


I have an additional question about the thread "CExtGridWnd in virtual mode" which seems to be read-only:


 


Is it also possible to use virtual mode for grids not representing a database table, for instance a very large array of strings? Creating a lot of CExtGridCells takes a lot of time. Matbe it is better to create cells as soon as they get visible. Is that possible stil having the possibility to order columns.


Is there some example to do this?


Thanks in advance.


 


Hello,

Is it possible to make a "CExtGridWnd List" like this?



http://www.codeproject.com/listctrl/virtuallist.asp




</td>
</tr>
<tr>
<td>

</td>
<td style="white-space: nowrap; font-weight: bold">Technical Support </td>
<td style="white-space: nowrap">Nov 7, 2006 - 1:05 PM </td>
</tr>
<tr>
<td style="padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" colspan="3">


Reply


Yes, this is fully supported in the Prof-UIS grid. The solution is based on coding a CExtGridDataProviderRecordSet-derived class and implementing all the abstract methods. The cacheable and virtual grid windows are demonstrated in the AdoRecordsetView sample. Open the recordset options dialog and specify database connection settings and an SQL Query. Now you can click OK to see the results in the grid window. There is a check box in the recordset options dialog: Use Virtual Mode. If it is checked, data are displayed in the virtual mode. If it is unchecked, the simple cacheable mode is used instead. In fact, both modes are based on caching. This means the grid window keeps only data records which are visible on the screen. But simple cacheable mode is based on a database recordset with a known number of rows in the query result and you can see the vertical scrollbar that is working classically. The virtual mode is based on a recordset with an unknown number of rows. The vertical scrollbar in the virtual mode can have only three states: top, middle and bottom. The virtual database recordset knows only the current record position and whether the current record at this position is the first and/or last record in the returned table. This explains the meaning of the grid virtual mode and the behavior of the scroll bar in this mode. The virtual mode can be used if the data base API supports only this kind of recordset or if you have a very large scrollable data range which often becomes updated dynamically. The Prof-UIS grid window supports the cacheable and/or virtual scrolling strategies in both horizontal and vertical directions even at the same time. So, scrolling an unlimited data source is not a problem.




</td>
</tr>
</tbody>
</table>


 

Borremans Pierre Dec 9, 2010 - 3:57 AM

Is it possible to use this virtual mode with a CExtTreeGridWnd or CExtTreeCtrl ?


Is it faster ? it’s for showing files in a directory (more than 1000 files)

Technical Support Dec 9, 2010 - 11:17 AM

The virtually cacheable mode is currently supported by the CExtGridWnd plain grid control only. The tree controls both in Prof-UIS and Win32 do not support it.

Bart Kampers Jun 25, 2010 - 9:06 AM

Thank you. Very nice!


Stilt tow questions:


- Is it possible to hide the scrollbars when they aer not needed? Most of the time the data to show is very large, but sometimes it is small.


- Is there a smart way to sort colums or do I have to sort the provided data first?


 

Technical Support Jun 25, 2010 - 11:50 AM

The CExtScrollWnd::OnSwHasScrollBar() and CExtScrollWnd::OnSwCanAutoHideScrollBar() virtual methods allow you to control the behavior and persistent visibility or invisibility of scroll bars.
The virtually cacheable grids do not support sorting. Your code should sort externally stored data or query some external database to return sorted data. Although it’s possible to enable sorting in virtually cacheable grids and make it displaying sort arrows, your code should handle the header cell clicks and perform sorted data reloading using the CExtScrollItemWnd::SiwFireCacheChanging() API.

Borremans Pierre Jun 24, 2010 - 3:16 AM

Is it possible to use this virtual mode and printing all data ?

Technical Support Jun 25, 2010 - 3:20 AM

The printing and print preview is supported for virtually cacheable grid controls with a known row count. The print preview subsystem simply scrolls the invisible grid control to let it upload the grid cells before they become printed.
The printing and print preview is NOT supported for virtually cacheable grid controls with an unknown row count.

Technical Support Jun 19, 2010 - 11:45 AM

Yes, it’s possible to use the virtually cached mode without databases. Yes, it’s possible to make the virtually cached grid editable. But please note: the virtually cached grid does not know where the real data is stored and you will need to handle the end-of-editing cell events and manually save data were it should be saved too. First of all, we have the editable version of the AdoRecordsetView sample application:

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

And here is the simple cacheable grid based sample application similar to what you asked for:

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