Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sorted collection is not sorted in table #266

Unanswered
JanRajnoha asked this question in Q&A
Sorted collection is not sorted in table #266
Dec 12, 2025 * 3 comments * 11 replies
Return to top
Discussion options

JanRajnoha
Dec 12, 2025

Hello,
I'm currently implementing preview version of TableView (1.4.0) where I have about 500 items. I need items sorted, but when i check displayed data, they are not sorted by any property, it is completely random.

What I do:

  1. Load items
  2. Sort items
  3. Load items into TableView via binding
  4. Data are random placed

Interesting is, when i do custom filtration and clear it, data are correctly sorted.
I checked collection, that is loaded into table and is sorted correctly.

Do you know, what could be problem? What could I try to make it work correctly?
Thank you for your ideas

You must be logged in to vote

Replies: 3 comments 11 replies

Comment options

w-ahmad
Dec 12, 2025
Maintainer

It's hard to assume what's going on, could you paste the code here so I can see your implementation?

You must be logged in to vote
0 replies
Comment options

JanRajnoha
Dec 13, 2025
Author

Okay,

I get items from API and sorted it:

Items = [.. result.Data.OrderBy(x => x.StartTime).ThenBy(x => x.SelectedTableItemId)];

I checked data in Items and are correctly sorted. Items is ObservableCollection
After it, I will bind Items into TableView and result is how I mentioned, unsorted data.

When I do some full text filter and clear it, it will get sorted data correctly. Collection is not modified during time

Full text search code:

private bool FullTextFilter(object item)
{
if (string.IsNullOrWhiteSpace(_fullText)) return true;
if (item is null) return false;

var model = item as ReservationListModel;
return model.Name?.Contains(_fullText, StringComparison.OrdinalIgnoreCase) is true ||
model.Email?.Contains(_fullText, StringComparison.OrdinalIgnoreCase) is true ||
model.PhoneNumber?.Contains(_fullText, StringComparison.OrdinalIgnoreCase) is true;
}

I checked IDs, that are in sorted list and are randomized through whole table

I tied sort with ID, but result is same

I don't know, if it is problem of list view, but I found out, if users scroll too fast through ListView, they could get random items at the end of list.

You must be logged in to vote
0 replies
Comment options

w-ahmad
Dec 17, 2025
Maintainer

It seems like there's some odd behavior with the base control. I suspected it might be an issue with CollectionView, but after testing, it appears to be working fine. It would be great if you could upload a test app so I can reproduce the problem and pinpoint exactly where the issue lies.

You must be logged in to vote
11 replies
Comment options

JanRajnoha Jan 17, 2026
Author

i can't believe it, but i did it. I did something like reading from API - decoding huge json with 405 items (json is in code) and it could perfectly reproduce the problem. Beside this, there is repro in app for bugs #269, #270, #271

Repo with all bugs

Comment options

w-ahmad Jan 19, 2026
Maintainer

thanks for sharing this app. I think the data is correctly sorted and as per your logic. the other issue like #270 it is working fine.
the issue #271 is happening because your DataGridAlternateBackground is a Color, it should be a brush.
for #269, there are some other areas where the binding isn't working like withing column definitions or conditional styles definitions. I'm not sure where is the problem but I'm trying to figure it out.
if you want you can contact me at Discord _waheedahmad) about the sorting issue.

Comment options

JanRajnoha Jan 19, 2026
Author

Thank you for your reply and I just sent you invite on Discord (Mike). Maybe it will be better to look at my app, cause i have no idea, what could be wrong. And we could check frozen columns too, because it is still problem. Thank you for your help.

Comment options

w-ahmad Jan 20, 2026
Maintainer

@JanRajnoha we found that this issue is fixed within pr #277 and would be available in next preview release. Hope this answer your question.

Comment options

JanRajnoha Jan 21, 2026
Author

Awesome, thank you for you help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants