wpf-devexpress-dot-xpf-dot-grid-dot-columnbase-72354e24.md
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
[Browsable(false)]
public int SortIndex { get; set; }
<Browsable(False)>
Public Property SortIndex As Integer
| Type | Description |
|---|---|
| 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.
<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
<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
<dxg:GridControl ItemsSource="{Binding Items}">
<dxg:GridColumn FieldName="State" IsSmart="True" SortIndex="0"/>
<dxg:GridColumn FieldName="Sales" IsSmart="True"/>
<dxg:GridControl ItemsSource="{Binding Items}">
<dxg:GridColumn FieldName="State" IsSmart="True" SortIndex="0"/>
<dxg:GridColumn FieldName="Sales" IsSmart="True"/>
<dxg:GridColumn FieldName="Name" />
<dxg:GridColumn FieldName="Value" GroupIndex="1" SortIndex="1" />
</dxg:GridControl.Columns>
See Also