You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A tap on the column header rarely triggers a dataGrid sorting event.
When you click with the mouse on column header, the event is always triggered immediately, as expected.
Regression
No response
Reproducible in sample app?
This bug can be reproduced in the sample app.
Steps to reproduce
To reproduce:
1. Use Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
2. Set DataGrid requirements -> DataGrid.CanUserSortColumns and DataGridColumn.CanUserSort both to true
3. Handle the Sorting event and write a debug message to output window
4. Start the app on a device with a touch screen (e.g. a Surface)
5. Use mouse click on the column headers to get sorting events -> works fine
6. Use tap on the column headers to get sorting event -> only every 2nd or 3rd event will be raised.
Also change tap between the columns.
I reproduced the behavior in a small UWP App, here is the code:
<!-- MainPage.xaml -->
<Page
x:Class="DataGridSortingTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DataGridSortingTest"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<controls:DataGrid
x:Name="dataGrid"
IsTapEnabled="True"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalScrollBarVisibility="Visible"
VerticalScrollBarVisibility="Visible"
AreRowDetailsFrozen="True"
AreRowGroupHeadersFrozen="True"
AutoGenerateColumns="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
ColumnHeaderHeight="80"
GridLinesVisibility="None"
HeadersVisibility="Column"
IsReadOnly="True"
SelectionMode="Single"
RowHeight="40"
RowDetailsVisibilityMode="Collapsed"
CanUserSortColumns="True"
Sorting="dataGrid_Sorting">
<controls:DataGrid.Columns>
<controls:DataGridTextColumn Header="COL1"
CanUserSort="True"
SortDirection="{x:Null}"
Tag="COL1"
/>
<controls:DataGridTextColumn Header="COL2"
CanUserSort="True"
SortDirection="{x:Null}"
Tag="COL2"
/>
</controls:DataGrid.Columns>
</controls:DataGrid>
</Grid>
</Page>
// MainPage.xaml.cs
private void dataGrid_Sorting(object sender, Microsoft.Toolkit.Uwp.UI.Controls.DataGridColumnEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Sort: " + e.Column.Tag.ToString());
}
Expected behavior
The tap action on column header should trigger a sorting event for each tab, just like clicking with the mouse.
Screenshots
By mouse click 5xCOL1 and 5xCOL2
By tap 5xCOL1 and 5xCOL2
Windows Build Number
Windows 10 1809 (Build 17763)
Windows 10 1903 (Build 18362)
Windows 10 1909 (Build 18363)
Windows 10 2004 (Build 19041)
Windows 10 20H2 (Build 19042)
Windows 10 21H1 (Build 19043)
Windows 11 21H2 (Build 22000)
Other (specify)
Other Windows Build number
No response
App minimum and target SDK version
Windows 10, version 1809 (Build 17763)
Windows 10, version 1903 (Build 18362)
Windows 10, version 1909 (Build 18363)
Windows 10, version 2004 (Build 19041)
Other (specify)
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
17.6.6
Device form factor
Desktop
Nuget packages
Microsoft.Toolkit.Uwp.UI.Controls 7.1.3
Including the transitive packages:
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.3
Additional context
No response
Help us help you
No.
The text was updated successfully, but these errors were encountered:
Hello TorstenKannler, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
Describe the bug
A tap on the column header rarely triggers a dataGrid sorting event.
When you click with the mouse on column header, the event is always triggered immediately, as expected.
Regression
No response
Reproducible in sample app?
Steps to reproduce
Expected behavior
The tap action on column header should trigger a sorting event for each tab, just like clicking with the mouse.
Screenshots
By mouse click 5xCOL1 and 5xCOL2
By tap 5xCOL1 and 5xCOL2
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
17.6.6
Device form factor
Desktop
Nuget packages
Microsoft.Toolkit.Uwp.UI.Controls 7.1.3
Including the transitive packages:
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.3
Additional context
No response
Help us help you
No.
The text was updated successfully, but these errors were encountered: