CommunityToolkit/WindowsCommunityToolkit

DataGrid sample not sorting the First Ascent Column

Open

#4,533 opened on Apr 15, 2022

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (5,708 stars) (1,403 forks)batch import
DataGrid :capital_abcd:bug :bug:help wantedsample app 🖼sample bug :bug:

Description

Describe the bug

Follow up from Discord discussion here

Looks like our sample in the sample app isn't properly sorting the DateTime column for some reason (there's no reason why this shouldn't be possible, but feel like something in the logic is currently missing for this added column).

Needs to be looked at under the debugger. Trying to remember if this worked when I first added the column... Don't have time to look at this at the moment though.

https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/00e9790337b17115ca9f7d2b966422f7f221f275/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/DataGrid/DataGridPage.xaml.cs#L139-L174

It does have a Tag though:

https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/00e9790337b17115ca9f7d2b966422f7f221f275/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/DataGrid/DataGridCode.bind#L90

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

1. Open DataGrid sample in sample app
2. Click on `CanUserSortColumns` to set to true
3. Try clicking on the First Ascent column.

Note... the column doesn't react to sort. Assume it has something to do with the Tag/data mismatch in the code-behind for how sorting sorts the collection?

Expected behavior

Column should sort.

Screenshots

No response

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

No response

Visual Studio Build Number

No response

Device form factor

No response

Nuget packages

No response

Additional context

No response

Help us help you

Yes, but only if others can assist.

Contributor guide