Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Most of the online documentation demonstrates adding rows to a TreeView using the ListView.AppendValues method. For example:
Using this method successfully adds a row to the TreeView, however that row is added to the end of the TreeView, ignoring any sorting setup on the TreeView/store. Using the Append/SetValue method works as expected. So this does not honor sorting:
But this does:
TreeIter iter = store.Append();
store.SetValue(iter, 0, item1);
iter = store.Append();
store.SetValue(iter, 0, item2);
Nothing in the documentation indicates that these methods should produce different results.
The above should say "ListStore.AppendValues" instead of "ListView.AppendValues".
How did you enable sorting? I suspect either it's not supposed to behave how you expect, or a GTK+ bug. GTK# is a thin wrapper over GTK+. We'd need a complete test case to investigate.
GTK+ docs are also useful: https://developer.gnome.org/gtk2/2.24/GtkListStore.html
Created attachment 5014 [details]
A test GTK# window, testing TreeViews and sorting.
I thought I had adequately isolated this, but apparently not. After creating the attached code which mirrors our usage pretty closely, I am unable to reproduce this. We also remove the model, bulk add data, and re-add the model, so there's a possibility the bug happens somewhere in that process. If I can find it later, I'll re-open this with a working example.
Okay, I'll mark it resolved for now.