Completed
Last Updated: 07 Jun 2023 07:41 by ADMIN
Release 5.2.0
Dmitry
Created on: 17 Feb 2022 16:03
Category: DataGrid
Type: Bug Report
0
DataGrid: TemplateColumn is not initially sorted when SortDescriptor is applied

Having this setup:

<telerikDataGrid:DataGridTemplateColumn HeaderText="Age" 
                                        CanUserSort="True">
    <telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
        <DataTemplate>
            <Label Text="{Binding Age}" />
        </DataTemplate>
    </telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
    <telerikDataGrid:DataGridTemplateColumn.SortDescriptor>
        <telerikCommon:PropertySortDescriptor PropertyName="Age" SortOrder="Descending" />
    </telerikDataGrid:DataGridTemplateColumn.SortDescriptor>
</telerikDataGrid:DataGridTemplateColumn>

 

When applying SortDescriptor to the Template column, the column is not initially sorted. 

1 comment
ADMIN
Didi
Posted on: 17 Feb 2022 16:11

Workaround: 

Execute the ColumnHeaderTap command on the template column inside the page's constructor, after initialize component: 

this.dataGrid.CommandService.ExecuteCommand(DataGridCommandId.ColumnHeaderTap, this.dataGrid.Columns[1]);

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.