How to set Default sorted Collumn |
Post Reply |
Author | ||
michael_veloso
Newbie Joined: 26 October 2015 Location: Perth Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 26 October 2015 at 10:39pm |
|
Hello, First time here
I have a question about CXTPReportControl, mfc c++ I would like to know how to set a default sort collumn. 1 side has file names and the other has modified dates, so I always want by default for the list to be sorted by the last modified date on the top. So after all records have been added, is there a sortbycollumn(col num) ? I cant seam to find any post or examples that show this. Surely there must be something that allows this. Appreciate your help. |
||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(1)
|
|
|
||
michael_veloso
Newbie Joined: 26 October 2015 Location: Perth Status: Offline Points: 3 |
Post Options
Thanks(0)
|
|
Thank you for the reply, I found a way in the end.
//sort by column 2 descending CXTPReportColumn* pColumn = m_GridCtrl.GetColumns()->GetAt(LETTER_TIMEDATE_COL); if (pColumn) m_GridCtrl.GetColumns()->SetSortColumn(pColumn, false); But your solutions seams more robust. As it clears any previous settings then sorts the column.
|
||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|
CXTPReportColumns::SetSortColumn do the same
But in first case you can also use CXTPReportColumnOrder::InsertAt and CXTPReportColumnOrder::RemoveAt to add/remove several columns in sort order. And SetSortColumn() sets just one column. |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |