Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
Sorting for UnBound Field
posted

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">

<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.LastName,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="Gender" Label="Gender">

<igDP:Field.Settings>

<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">

<igDP:FieldSettings.EditorStyle>

<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}"/>

<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="Phone" Label="Phone">

<igDP:Field.Settings>

<igDP:FieldSettings EditorType="{x:Type igEditors:XamMaskedEditor}">

<igDP:FieldSettings.EditorStyle>

<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}"/>

<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="DepartmentID" Label="Deparment ID">

<igDP:Field.Settings>

<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">

<igDP:FieldSettings.EditorStyle>

<Style TargetType="{x:Type igEditors:XamComboEditor}">

<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}"/>

<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:FieldLayout.Fields>

</igDP:FieldLayout>

</igDP:XamDataGrid.FieldLayouts>

</igDP:XamDataGrid>

 

 

 

Thanks,

R.Ramesh Babu.