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 » in a CExtGidWnd(with numerical cells) how to programmatically sort the rows within a range of rows Collapse All
Subject Author Date
Claudiu Tanasescu Apr 30, 2010 - 6:04 AM

Hi support,


I have a CExtGidWnd, with numerical cells, and i want to sort programmatically, by a column, rows within a range.

For sample example, in a grid with 6 rows and 3 columns. I want to sort only the rows of row 1 to row 4, using values of column 0.


row 0 : 7 23 52
row 1 : 4 23 52 <--- _1
row 2 : 9 23 52 <--- _2
row 3 : 6 23 52 <--- _3
row 4 : 8 23 52 <--- _4
row 5 : 3 23 52

after sorting:

row 0 : 7 23 52
row 1 : 4 23 52 <--- _1
row 2 : 6 23 52 <--- _3
row 3 : 8 23 52 <--- _4
row 4 : 9 23 52 <--- _2
row 5 : 3 23 52

is this possible?

Technical Support May 3, 2010 - 8:27 AM

The CExtGridWnd::GridSortOrderSetup() allows you to sort the grid control by an entire row range only. But you can add a column with a zero width and specify some appropriate values in it. The rows <code>1..4<code> should have the same values as they have in the first column. The row <code>0<code> should have some very small value and the row <code>5<code> should have some very large value. Such zero width column can be used for sorting rows as you need.