Open sinatrocious opened 6 months ago
Possible workaround is to send click event to first column:
var firstColumn = Children<TreeDataGridColumnHeader>(treeDataGrid).First();
firstColumn.RaiseEvent(new RoutedEventArgs { RoutedEvent = Button.ClickEvent });
Describe the bug
I am setting column
SortDirection
in code, but the sorting is not happening. Sorting seems to only works if I click column header.To Reproduce
Avalonia.Controls.TreeDataGrid
nuget.Repro
App.axaml ```axamlExpected behavior
I expect sorting to work according to
SortDirection
.Environment
Additional context
I've tried to set
SortDirection
after 5s delay after window is shown. The column header will show arrow, but no sorting occurs. I guess thispublic
property is used internally to toggle displaying of arrow, but then how do I force sorting?I guess simulating mouse click on column header is a workaround, but after quick research I am unable to find anything what can help me to build such workaround.