Bug 15037 - ListStore.AppendValues does not honor sorting
Summary: ListStore.AppendValues does not honor sorting
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: 2.x
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-09-27 12:12 UTC by Matthew Trumbell
Modified: 2013-09-27 17:17 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

A test GTK# window, testing TreeViews and sorting. (5.24 KB, text/plain)
2013-09-27 17:03 UTC, Matthew Trumbell

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Matthew Trumbell 2013-09-27 12:12:24 UTC
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:

store.AppendValues(item1, item2);

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.
Comment 1 Matthew Trumbell 2013-09-27 12:18:44 UTC
The above should say "ListStore.AppendValues" instead of "ListView.AppendValues".
Comment 2 Mikayla Hutchinson [MSFT] 2013-09-27 15:10:19 UTC
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
Comment 3 Matthew Trumbell 2013-09-27 17:03:10 UTC
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.
Comment 4 Mikayla Hutchinson [MSFT] 2013-09-27 17:17:34 UTC
Okay, I'll mark it resolved for now.