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 Tech Support » CExtGridWnd sort questions Collapse All
Subject Author Date
Francesco Toscano Jan 16, 2008 - 11:29 AM

I would like to save the sort order state of the columns of my derived "CExtGridWnd" in the windows registry, is it possible?

Then supposing that it is possible, I know that I can use "CExtGridWnd::GridSortOrderGet(...)" to get the sort order and "CExtGridWnd::GridSortOrderSetup(...)" to apply the previous saved order next time to the grid.

But How can I check if the number of the columns which the sort order is refered is changed?
In other words: suppose that I save the columns order for a grid that have 5 columns, at the next time the application it is executed the grid has changed ( ..for some reasons... ), the columns number. Whats happens if I try to apply the previous saved column order states? How can I check that the saved sort order refers to a grid condition that do not exist anymore?

thanks in advance!

Technical Support Jan 17, 2008 - 3:50 AM

The CExtGridDataSortOrder class supports an CArchive-based serialization through its Serialize() method. You should create an CArchive object based on a CMemFile object and serialize a CExtGridDataSortOrder object. You can use the CExtCmdManager::FileObjToRegistry() and CExtCmdManager::FileObjFromRegistry() methods for loading the content of the CMemFile object from the registry or writing it to the registry. There is a CExtCmdProfile::SerializeState() which you can use as a good example of registry-based serialization. Of course, you should ensure that the CExtGridDataSortOrder data loaded from the registry corresponds to the columns of your grid window. So, you may need to serialize some additional information to the same CArchive object. This information can describe column count, column names, etc.