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 and sorting cols Collapse All
Subject Author Date
Simon DESEE Aug 8, 2006 - 10:58 AM

Hello all,

How can I limit the columns sorting functionality to the N first lines of my grid?

Typically, I want to add 20 rows on my grid. Only the 15 first rows will be sortable, the 5 final rows are for calcul and statistics (with no sorts).

Thanks for your help.

Technical Support Aug 10, 2006 - 5:03 AM

Here is a solution. Create a CExtGridDataProviderMemory-derived class and override the CExtGridDataProviderMemory::SortOrderUpdate() virtual method in it. Your method should be similar to the original version except it should invoke the CExtGridDataProviderMemory::_SortStep() internal method and specify the nLow and nHigh parameters as the row range you want to see sorted. Both nLow and nHigh values are computed as zero-based data row numbers plus the total number of header rows at the top and at the bottom. These rows are stored at the top of a two dimensional cell array of the memory data provider. You will also need to use your own CExtGridWnd-derived class and override the CExtGridWnd::OnGridQueryDataProvider() virtual method which should return a reference to your memory data provider instance.