This question is locked. New answers and comments are not allowed.
I am using RadDataGrid to display values in tabular form. I have added Sorting to two column that are DataGridTemplateColumn using PropertySortDescriptor. Now what is happening is the data is getting sorted when i click on one column but if now i click on second column the sort icon from the first column is not getting disappear and sort as per second column. How to fix this?
Code as below and snapshot attached:
<telerikGrid:RadDataGrid Grid.Column="1" Grid.Row="3" x:Name="DataGrid"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
SelectionMode="Single"
LayoutUpdated="DataGrid_LayoutUpdated"
UserSortMode="Single"
UserFilterMode="Disabled"
UserGroupMode="Disabled"
UserColumnReorderMode="None"
GridLinesVisibility="Horizontal"
AlternateRowBackground="#fcf3f3"
AlternationStartIndex="1"
AlternationStep="2"
RowBackground="#ffffff"
EnsureCurrentItemIntoView="False"
ManipulationMode="None"
GroupHeaderDisplayMode="Frozen"
AutoGenerateColumns="False"
Background="Transparent"
GridLinesBrush="#99908a"
Foreground="#65594d"
BorderThickness="0"
GridLinesThickness="1"
Margin="0,0,6,20">
<telerikGrid:DataGridTemplateColumn
CellContentTemplateSelector="{StaticResource UpDownInvoiceSalesTemplateSelector}"
HeaderStyle="{StaticResource HeaderStyleTopProduct}">
<telerikGrid:DataGridTemplateColumn.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding ElementName=thisPage, Path=Property1HeaderName}" Style="{StaticResource ReportTypeStyleTextTopProduct}"/>
</StackPanel>
</telerikGrid:DataGridTemplateColumn.Header>
<telerikGrid:DataGridTemplateColumn.SortDescriptor>
<telerikGrid:PropertySortDescriptor PropertyName="Property1"/>
</telerikGrid:DataGridTemplateColumn.SortDescriptor>
</telerikGrid:DataGridTemplateColumn>
<telerikGrid:DataGridTemplateColumn
CellContentTemplateSelector="{StaticResource UpDownSecondaryValueTopProductTemplateSelector}"
HeaderStyle="{StaticResource HeaderStyleTopProduct}">
<telerikGrid:DataGridTemplateColumn.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding ElementName=thisPage, Path=Property2HeaderName}" Style="{StaticResource ReportTypeStyleTextTopProduct}"/>
</StackPanel>
</telerikGrid:DataGridTemplateColumn.Header>
<telerikGrid:DataGridTemplateColumn.SortDescriptor>
<telerikGrid:PropertySortDescriptor PropertyName="Property2"/>
</telerikGrid:DataGridTemplateColumn.SortDescriptor>
</telerikGrid:DataGridTemplateColumn>
Code as below and snapshot attached:
<telerikGrid:RadDataGrid Grid.Column="1" Grid.Row="3" x:Name="DataGrid"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
SelectionMode="Single"
LayoutUpdated="DataGrid_LayoutUpdated"
UserSortMode="Single"
UserFilterMode="Disabled"
UserGroupMode="Disabled"
UserColumnReorderMode="None"
GridLinesVisibility="Horizontal"
AlternateRowBackground="#fcf3f3"
AlternationStartIndex="1"
AlternationStep="2"
RowBackground="#ffffff"
EnsureCurrentItemIntoView="False"
ManipulationMode="None"
GroupHeaderDisplayMode="Frozen"
AutoGenerateColumns="False"
Background="Transparent"
GridLinesBrush="#99908a"
Foreground="#65594d"
BorderThickness="0"
GridLinesThickness="1"
Margin="0,0,6,20">
<telerikGrid:DataGridTemplateColumn
CellContentTemplateSelector="{StaticResource UpDownInvoiceSalesTemplateSelector}"
HeaderStyle="{StaticResource HeaderStyleTopProduct}">
<telerikGrid:DataGridTemplateColumn.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding ElementName=thisPage, Path=Property1HeaderName}" Style="{StaticResource ReportTypeStyleTextTopProduct}"/>
</StackPanel>
</telerikGrid:DataGridTemplateColumn.Header>
<telerikGrid:DataGridTemplateColumn.SortDescriptor>
<telerikGrid:PropertySortDescriptor PropertyName="Property1"/>
</telerikGrid:DataGridTemplateColumn.SortDescriptor>
</telerikGrid:DataGridTemplateColumn>
<telerikGrid:DataGridTemplateColumn
CellContentTemplateSelector="{StaticResource UpDownSecondaryValueTopProductTemplateSelector}"
HeaderStyle="{StaticResource HeaderStyleTopProduct}">
<telerikGrid:DataGridTemplateColumn.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding ElementName=thisPage, Path=Property2HeaderName}" Style="{StaticResource ReportTypeStyleTextTopProduct}"/>
</StackPanel>
</telerikGrid:DataGridTemplateColumn.Header>
<telerikGrid:DataGridTemplateColumn.SortDescriptor>
<telerikGrid:PropertySortDescriptor PropertyName="Property2"/>
</telerikGrid:DataGridTemplateColumn.SortDescriptor>
</telerikGrid:DataGridTemplateColumn>