Back to Devexpress

ColumnBase.SortIndex Property

wpf-devexpress-dot-xpf-dot-grid-dot-columnbase-72354e24.md

latest4.0 KB
Original Source

ColumnBase.SortIndex Property

Gets the column’s position among sorted columns.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
[Browsable(false)]
public int SortIndex { get; set; }
vb
<Browsable(False)>
Public Property SortIndex As Integer

Property Value

TypeDescription
Int32

An integer value that specifies the zero-based column’s index among sorted columns. -1 if data is not sorted by this column.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the SortIndex property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-data-grid-getting-started-net-framework/CS/WPFDataGridGettingStartedNETFramework/MainWindow.xaml#L17

xml
<dxg:GridColumn FieldName="OrderID" IsSmart="True"/>
<dxg:GridColumn FieldName="CustomerID" IsSmart="True" SortIndex="0" SortOrder="Ascending"/>
<dxg:GridColumn FieldName="OrderDate" IsSmart="True" SortIndex="1" SortOrder="Descending"/>

wpf-data-grid-getting-started-dot-net/CS/WPFDataGridGettingStartedDotNET/MainWindow.xaml#L31

xml
<dxg:GridColumn FieldName="OrderId" IsSmart="True"/>
<dxg:GridColumn FieldName="CustomerId" IsSmart="True" SortIndex="1" SortOrder="Ascending"/>
<dxg:GridColumn FieldName="OrderDate" IsSmart="True" SortIndex="0" SortOrder="Descending"/>

wpf-data-grid-apply-conditional-formatting/CS/ConditionalFormatting/MainWindow.xaml#L13

xml
<dxg:GridControl ItemsSource="{Binding Items}">
    <dxg:GridColumn FieldName="State" IsSmart="True" SortIndex="0"/>
    <dxg:GridColumn FieldName="Sales" IsSmart="True"/>

how-to-apply-conditional-formatting-in-code-behind-t281415/CS/ConditionalFormatting/MainWindow.xaml#L12

xml
<dxg:GridControl ItemsSource="{Binding Items}">
    <dxg:GridColumn FieldName="State" IsSmart="True" SortIndex="0"/>
    <dxg:GridColumn FieldName="Sales" IsSmart="True"/>

wpf-data-grid-call-begindataupdate-and-enddataupdate-at-view-model-level/CS/BeginEndDataUpdate/MainWindow.xaml#L29

xml
<dxg:GridColumn FieldName="Name" />
    <dxg:GridColumn FieldName="Value" GroupIndex="1" SortIndex="1" />
</dxg:GridControl.Columns>

See Also

Sorting

ColumnBase Class

ColumnBase Members

DevExpress.Xpf.Grid Namespace