Objective Grid: Sorting columns and rows

Article ID: 679
Last updated: 11 Apr, 2018
Article ID: 679
Last updated: 11 Apr, 2018
Revision: 3
Views: 3596
Posted: 12 Jan, 2001
by Meltreger B.
Updated: 11 Apr, 2018
by Meltreger B.

Problem


How can I sort multiple column/rows with a single double-click?


Cause



Action


Override OnLButtonDblClkRowCol() and use the following code snippet:

CRowColArray awCols;
ROWCOL numcols=GetSelectedCols(awCols,TRUE,FALSE);
CGXSortInfoArray sortInfo;
sortInfo.SetSize(numcols);

for (ROWCOL x=0;x<numcols;x++)
{

sortInfo[x].nRC = awCols[x];
sortInfo[x].sortType = CGXSortInfo::autodetect;

if (pParam->m_nLastSortedCol != nCol || !pParam->m_bSortAscending)

sortInfo[x].sortOrder = CGXSortInfo::ascending;
else
sortInfo[x].sortOrder = CGXSortInfo::descending;
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 679
Last updated: 11 Apr, 2018
Revision: 3
Views: 3596
Posted: 12 Jan, 2001 by Meltreger B.
Updated: 11 Apr, 2018 by Meltreger B.

Others in this category