Hi,
Is sorting supported for a unbound columns?
In my case all the columns are unbound.
<igDP:XamDataGrid HorizontalAlignment="Stretch" WControls:XamDataGridBehavior.IsSynchronizedWithCurrentItem="True" RecordLoadMode="PreloadRecords" VerticalAlignment="Stretch" DataSource="{Binding Path=CollectionView}" Margin="0,0,0,0" Grid.Row="0" GroupByAreaLocation="None">
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowEdit="True"/>
</igDP:XamDataGrid.FieldSettings>
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False" AllowAddNew="False" AllowDelete="True" AddNewRecordLocation="OnTopFixed"/>
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:UnboundField Name="FirstName" Label="First Name">
<igDP:Field.Settings>
<igDP:FieldSettings EditorType="{x:Type igEditors:XamTextEditor}">
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamTextEditor}">
<Setter Property="Text" Value="{Binding Path=DataItem.FirstName,Mode=TwoWay,ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors), Converter={StaticResource errorConverter}}"/>
</Trigger>
</Style.Triggers>
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:UnboundField>
<igDP:UnboundField Name="LastName" Label="Last Name">
<Setter Property="Text" Value="{Binding Path=DataItem.LastName,Mode=TwoWay,ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
<igDP:UnboundField Name="Gender" Label="Gender">
<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">
<Style TargetType="{x:Type igEditors:XamComboEditor}">
<Setter Property="DisplayMemberPath" Value="Name" />
<Setter Property="ValuePath" Value="GenderID"/>
<Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},Path=DataContext.Genders}" />
<Setter Property="Value" Value="{Binding Path=DataItem.Gender,Mode=TwoWay,ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
<igDP:UnboundField Name="Phone" Label="Phone">
<igDP:FieldSettings EditorType="{x:Type igEditors:XamMaskedEditor}">
<Style TargetType="{x:Type igEditors:XamMaskedEditor}">
<Setter Property="Mask" Value="(###)-###-####"/>
<Setter Property="Value" Value="{Binding Path=DataItem.Phone,Mode=TwoWay,ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
<igDP:UnboundField Name="DepartmentID" Label="Deparment ID">
<Setter Property="DisplayMemberPath" Value="DepartmentName" />
<Setter Property="ValuePath" Value="DepartmentID"/>
<Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},Path=DataContext.Departments}" />
<Setter Property="Value" Value="{Binding Path=DataItem.DepartmentID,Mode=TwoWay,ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Thanks,
R.Ramesh Babu.
In order to enable sorting you need to set the "LabelClickAction" property of a FieldSettings object to a value allowing sorting.
For more detailed information on sorting, please refer to the following article:
http://help.infragistics.com/Help/NetAdvantage/WPF/2010.3/CLR4.0/html/xamDataPresenter_About_Sorting.html
Hope this helps.
the manual sorting works. But I want that the table is automatically sorted already during loading by the 2. Column (unbound) alphabetically.