Defines whether sort indicators are shown.
Get
| C# | SftTreeHeaderSortIndicatorsConstants Style = object.SortIndicators; |
| VB.NET | Style = object.SortIndicators As SftTreeHeaderSortIndicatorsConstants |
| C++ | enum SftTreeHeaderSortIndicatorsConstants Style = object->SortIndicators; enum SftTreeHeaderSortIndicatorsConstants Style = object->GetSortIndicators(); |
| C | HRESULT object->get_SortIndicators(enum SftTreeHeaderSortIndicatorsConstants* Style); |
| VB | Style = object.SortIndicators As SftTreeHeaderSortIndicatorsConstants |
Put
| C# | SftTreeHeaderSortIndicatorsConstants object.SortIndicators = Style; |
| VB.NET | object.SortIndicators = Style As SftTreeHeaderSortIndicatorsConstants |
| C++ | enum SftTreeHeaderSortIndicatorsConstants object->SortIndicators = Style; void object->PutSortIndicators(enum SftTreeHeaderSortIndicatorsConstants Style); |
| C | HRESULT object->put_SortIndicators(enum SftTreeHeaderSortIndicatorsConstants Style); |
| VB | object.SortIndicators = Style As SftTreeHeaderSortIndicatorsConstants |
object
A SftTreeHeaders object.
Style
Defines whether sort indicators are shown.
| Style | Value | Description |
|---|---|---|
| headerSortIndicatorsSftTreeNone | 0 | None. Sort indicators are not displayed. |
| headerSortIndicatorsSftTreeAuto | 1 | Automatic. Sort indicators are displayed and the tree control automatically responds to mouse button clicks to change sort order and sorted column. |
| headerSortIndicatorsSftTreeManual | 2 | Manual. Sort indicators are displayed but the tree control does not automatically respond to mouse button clicks to change sort order and sorted column. |
The SortIndicators property defines whether sort indicators are shown.
The tree control will never automatically sort the data.
With headerSortIndicatorsSftTreeAuto the tree control automatically updates sort indicators in response to mouse clicks. The ItemClick event (AreaType = constSftTreeColumnHeader) can be used to determine when the header was clicked, meaning the sort indicator was clicked. The Header.SortIndicator property can be used to determine the status of sort indicators when handling the ItemClick event. The application has to sort the data based on the sort indicators, usually using the Items.SortDependents method.
With headerSortIndicatorsSftTreeManual the application must change sort indicators explicitly. The Header.SortIndicator property can be used to update the status of sort indicators. The application has to sort the data based on the sort indicators, usually using the Items.SortDependents method.
AddMessage(1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, false);
itemIndex = axSftTree1.Items.get_ItemIndex(m_SavedFolder);
axSftTree1.get_Item(itemIndex).Collapse(false);
m_DeletedFolder = AddFolder("Deleted", "Deleted messages", 0);
axSftTree1.ColumnsObj.MakeOptimal();
axSftTree1.Items.RecalcHorizontalExtent();
axSftTree1.Splitter.MakeOptimal();
// allow sorting
axSftTree1.Headers.SortIndicators = SftTreeHeaderSortIndicatorsConstants.headerSortIndicatorsSftTreeAuto;
axSftTree1.Items.Current = 0;
axSftTree1_CaretChange(this, new _DSftTreeEvents_CaretChangeEvent(0));
}
private int AddFolder(string folder, string desc, int count)
{
AddMessage(1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, False)
ItemIndex = AxSftTree1.Items.ItemIndex(m_SavedFolder)
AxSftTree1.get_Item(ItemIndex).Collapse(False)
m_DeletedFolder = AddFolder("Deleted", "Deleted messages", 0)
AxSftTree1.ColumnsObj.MakeOptimal()
AxSftTree1.Items.RecalcHorizontalExtent()
AxSftTree1.Splitter.MakeOptimal()
' allow sorting
AxSftTree1.Headers.SortIndicators = SftTreeHeaderSortIndicatorsConstants.headerSortIndicatorsSftTreeAuto
AxSftTree1.Items.Current = 0
AxSftTree1_CaretChange(Me, New _DSftTreeEvents_CaretChangeEvent(0))
End Sub
Private Sub AxSftTree1_CaretChange(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_CaretChangeEvent) Handles AxSftTree1.CaretChange
' set column headers based on selected item
AddMessage(1, _T("me@mycompany.com"), _T("You're hired"), _T("10/01/05"), 4, FALSE);
AddMessage(1, _T("anyone@acompany.com"), _T("Re: You're hired"), _T("10/11/05"), 6, FALSE);
m_vTree->Item[m_vTree->Items->ItemIndex[m_SavedFolder]]->Collapse(VARIANT_FALSE);
m_DeletedFolder = AddFolder(_T("Deleted"), _T("Deleted messages"), 0);
m_vTree->ColumnsObj->MakeOptimal();
m_vTree->Items->RecalcHorizontalExtent();
m_vTree->Splitter->MakeOptimal();
// allow sorting
m_vTree->Headers->SortIndicators = headerSortIndicatorsSftTreeAuto;
m_vTree->Items->Current = 0;
OnCaretChangeSftTree1(0); // to update column headers
return TRUE; // return TRUE unless you set the focus to a control
}
AddMessage 1, "me@mycompany.com", "You're hired", "10/01/05", 4, False
AddMessage 1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, False
.Item(.Items.ItemIndex(SavedFolder)).Collapse False
DeletedFolder = AddFolder("Deleted", "Deleted messages", 0)
.ColumnsObj.MakeOptimal
.Items.RecalcHorizontalExtent
.Splitter.MakeOptimal
' allow sorting
.Headers.SortIndicators = headerSortIndicatorsSftTreeAuto
.Items.Current = 0
SftTree1_CaretChange 0 ' to update column headers
End With
End Sub
Private Sub SftTree1_CaretChange(ByVal ItemIndex As Long)See Also SftTreeHeaders Object | Object Hierarchy