GrapeCity.Win.MultiRow Namespace > ColumnHeaderCell Class : SortMode Property |
<SRCategoryAttribute("Behavior")> <DefaultValueAttribute()> <SRDescriptionAttribute("Indicates which sort operation is performed.")> Public Property SortMode As SortMode
Dim instance As ColumnHeaderCell Dim value As SortMode instance.SortMode = value value = instance.SortMode
[SRCategory("Behavior")] [DefaultValue()] [SRDescription("Indicates which sort operation is performed.")] public SortMode SortMode {get; set;}
Exception | Description |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The specified value is not one of the SortMode values. |
System.InvalidOperationException | The assigned value is SortMode.NotSortable and the SortGlyphDirection is not System.Windows.Forms.SortOrder.None. -or- The assigned value is SortMode.Automatic and the SelectionMode is not MultiRowSelectionMode.None. |
You should set this property with SortCellIndex or SortCellName.
When you set this property to SortMode.Automatic and specify the SortCellIndex or SortCellName, once you click this ColumnHeaderCell, the specified cells in the row are sorted automatically, and a sort glyph is displayed on the cell to indicate the sort order. This behavior is not allowed to be used with SelectionMode.
When the control is sorted using a column with a SortMode property value of Programmatic, you must display the sorting glyph yourself with the SortGlyphDirection property.
private void Form1_Load(object sender, EventArgs e) { Template template1 = Template.CreateGridTemplate(4); ColumnHeaderCell columnHeaderCell = template1.ColumnHeaders[0][0] as ColumnHeaderCell; columnHeaderCell.SelectionMode = MultiRowSelectionMode.None; columnHeaderCell.SortMode = SortMode.Automatic; columnHeaderCell.SortCellName = "textBoxCell1"; gcMultiRow1.Template = template1; }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim template1 As Template = Template.CreateGridTemplate(4) Dim columnHeaderCell As ColumnHeaderCell = TryCast(template1.ColumnHeaders(0)(0), ColumnHeaderCell) columnHeaderCell.SelectionMode = MultiRowSelectionMode.None columnHeaderCell.SortMode = SortMode.Automatic columnHeaderCell.SortCellName = "textBoxCell1" gcMultiRow1.Template = template1 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