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
Developer Community or GitHub 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.
Created attachment 13040 [details]
Sample code to explain why ExpandItem does not work in some scenarios
If we set data source and delegate for the NSOutlineView, we could expand any item using ExpandItem. We are using a NSTreeController to bind the data from customized data source and then bind the NSOutlineView's content to this NSTreeController's arrangedObject. The data displays well and Expand(null, true) still works. But if we need to expand specific item, it does not work.
The sample program is attached for more details.
So, this is not a Xamarin.Mac bug. If you poke around the internet, you can find plenty of other people having issues with expand item:
and if you re-create your example in objective-c, you will see the same exact behavior.
As a one time thing, here's the corrected code:
BeginInvokeOnMainThread (() =>
this.typeListOutlineView.ExpandItem (typeListOutlineView.ItemAtRow(0), true);
this.typeListOutlineView.ExpandItem (typeListOutlineView.ItemAtRow(4), true);
If you are running into general "I'm having trouble with this API", you can ask questions here:
or check the documentation here:
In particular this may be useful:
In the future, please don't file bugs unless you reasonably believe they are specific to our C# binding on top of Cocoa.