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.
Hi guys,
I'm running into the same issue... but all the answers here don't actually point to anything helpful. The original question is still unanswered:
How do you sort an UNBOUND field?
I have an xaml style for a CellValuePresenter:
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="StatusFieldStyle"> <Setter Property="Value"> <Setter.Value> <MultiBinding Converter="{StaticResource StatusToValueConverter}"> <Binding Path="DataItem.Source.Prop1" /> <Binding Path="DataItem.Source.Prop2" /> </MultiBinding> </Setter.Value> </Setter> </Style>
And I declare my field with a sort comparer as so:
<igDP:UnboundField Name="Status" Label="" Width="32"> <igDP:UnboundField.Settings> <igDP:FieldSettings CellValuePresenterStyle="{StaticResource StatusFieldStyle}" SortComparer="{StaticResource StatusSorter}"/> </igDP:UnboundField.Settings></igDP:UnboundField>
The value converter returns the right value, but when I debug into the sorter, the values that are being passed into it are both NULL! What am I missing?
Thanks for your help,
-Ryan-
The second one for the xamDataPresenter :
http://help.infragistics.com/NetAdvantage/WPF/current/CLR4.0/?page=xamDataPresenter_About_Sorting.html
Hello Milan,
Below you could find the same link from our latest online documentation:http://help.infragistics.com/NetAdvantage/WPF/current/CLR4.0/?page=xamDataPresenter_Programmatically_Sort_and_Group_Fields.html
Please feel free to let me know if you have any other questions with this matter.
Look like both of the links mentioned are not working. Can you share the valid links?
Hi Djumana,
In this case I believe the following topic would be useful:
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamDataPresenter_Programmatically_Sort_and_Group_Fields.html