WireLess Studio Widgets Developer's Guide |
Allows the user to sort the items of a WS_LIST_CTRL widget in ascending or descending order when he clicks a column of the widget's header.
VARIANT_BOOL SetSortModeByName(LPCTSTR sObjectName, SHORT usMode);
VARIANT_BOOL SetSortModeById(SHORT usObjectId, SHORT usMode);
On success, SetSortMode returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
Modes to be set can be combined by using the bitwise OR ( | ) operator.
The available sort modes are:
The display modes can be found on the WSTWidgetConstants enumeration.
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); short sListCtrlId= 4; oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, ""); oWidget.AddColumById(sListCtrlId, 40, "Product Id"); oWidget.AddRowById(sListCtrlId, 0); oWidget.SetRowTextById(sListCtrlId, 0, 0, "1"); oWidget.AddRowById(sListCtrlId, 0); oWidget.SetRowTextById(sListCtrlId, 1, 0, "2"); oWidget.AddRowById(sListCtrlId, 0); oWidget.SetRowTextById(sListCtrlId, 2, 0, "3"); oWidget.SetSortModeById(sListCtrlId, (short)(WSTWidgetConstants.WS_LIST_CTRL_SORT_ASCENDING | WSTWidgetConstants.WS_LIST_CTRL_SORT_ASCENDING));
Public wsWidget As New WStWidget ... Case "sortCheckBox" If wsWidget.GetStateByName("sortCheckBox") = WS_STATE_CHECKED Then wsWidget.SetSortModeByName "myListCtrl", WS_LIST_CTRL_SORT_DESCENDING + _ WS_LIST_CTRL_SORT_ASCENDING Else wsWidget.SetSortModeByName "myListCtrl", WS_LIST_CTRL_SORT_DISABLED End If ...
SetRowText | DeleteRow | AddRow
WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference
WireLess Studio by SofToGo S.A. | Visit our site www.softogo.com | Contact us help@softogo.com |