DataGrid column header click does nothing?

Themes, Shared, and Core Libraries for Avalonia Forum

Posted 7 months ago by Michael Janulaitis - Corner Bowl Software
Avatar

When clicking on a column header the data is not sorted.   Items are added in real-time during the execution of a function. I have set the SortMemberPath and with a breakpoint on the sort properties I can see property being called, however the view does absolutely nothing when I click on the header:

<local:FlatDataGrid
Grid.Row="1"
x:Name="dataGrid"
CanUserSortColumns="True"
CanUserReorderColumns="False"
HorizontalScrollBarVisibility="Auto"
IsReadOnly="True"
IsRealTime="True"
ItemsSource="{Binding ItemVMs}">
 
<DataGrid.Columns>
<DataGridTemplateColumn Header="" SortMemberPath="SortedLevel" MinWidth="32" MaxWidth="32">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="lib:ServerLogEntryViewModel">
<ContentControl Theme="{Binding ImageStyle, Mode=OneTime, Converter={StaticResource StringToResourceConverter}}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn x:DataType="lib:ServerLogEntryViewModel" Header="{x:Static lib:Resources.TIME}" SortMemberPath="Time" Binding="{Binding DisplayTime, Mode=OneTime}" />
<DataGridTextColumn x:DataType="lib:ServerLogEntryViewModel" Header="{x:Static lib:Resources.MESSAGE}" SortMemberPath="Message" Binding="{Binding Message, Mode=OneTime}" />
 
</DataGrid.Columns>
</local:FlatDataGrid>

Comments (2)

Posted 7 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michael,

We aren't the authors of the Avalonia DataGrid control, we just have an optional theme for it.  If you have a question regarding its functionality you should post in the Avalonia GitHub repository and the team there will reply to you.


Actipro Software Support

Posted 6 months ago by Michael Janulaitis - Corner Bowl Software
Avatar

Add Comment

Please log in to a validated account to post comments.