Gets or sets the sort glyph direction.
The following code example shows how to customize sort behavior when the user clicks the column header cell. To run this example, create a GcMultiRow control in a form with a template. The template should contain at least one cell in the row and a column header cell in the column header section. The column header cell's SelectionMode should be None, and SortMode should be Programmatic.
void gcMultiRow1_CellClick(object sender, CellEventArgs e)
{
if (e.CellName == "ColumnHeaderCell1" && e.Scope == CellScope.ColumnHeader)
{
ColumnHeaderCell columnheaderCell = gcMultiRow1.ColumnHeaders[0][e.CellName] as
ColumnHeaderCell;
BindingSource bindingSource = this.gcMultiRow1.DataSource as BindingSource;
if (columnheaderCell.SortGlyphDirection == SortOrder.None || columnheaderCell.SortGlyphDirection
== SortOrder.Descending)
{
bindingSource.Sort = "scores ASC";
}
else
{
bindingSource.Sort = "scores DESC";
}
}
}
Private Sub gcMultiRow1_CellClick(ByVal sender As Object, ByVal e As CellEventArgs) Handles
gcMultiRow1.CellClick
If e.CellName = "ColumnHeaderCell1" AndAlso e.Scope = CellScope.ColumnHeader Then
Dim columnheaderCell As ColumnHeaderCell = TryCast(gcMultiRow1.ColumnHeaders(0)(e.CellName),
ColumnHeaderCell)
Dim bindingSource As BindingSource = TryCast(Me.gcMultiRow1.DataSource, BindingSource)
If columnheaderCell.SortGlyphDirection = SortOrder.None OrElse columnheaderCell.SortGlyphDirection
= SortOrder.Descending Then
bindingSource.Sort = "scores ASC"
Else
bindingSource.Sort = "scores DESC"
End If
End If
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2