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.
If I add a delegate to NSTableView.SelectionDidChange I cannot select rows anymore.
There definitely appears to be an issue with the events/delegates on NSTableView. For now as a workaround you can subclass NSTableViewDelegate and override the methods you care about. This appears to work as expected.
I'm looking into why the events/delegate properties directly on NSTableView are not working.
public override void AwakeFromNib ()
tableView.Delegate = new TableDelegate ();
class TableDelegate : NSTableViewDelegate
public override void SelectionDidChange (NSNotification notification)
Console.WriteLine ("Selection Changed (delegate)");
public override bool ShouldSelectRow (NSTableView tableView, int row)
return row % 3 == 0;
Thanks, it works well!
This happens in my case as well. Will try the workaround.
Yes, the workaround works.
This should be fixed in master / 2491f2f734e3052aabbfa9ac76c60ec8e23d7748 and should be in XM 2.0 (this summer).
Events on base and derived classes should now not stomp each other. We are not supporting using both the c# events and delegate at the same time. If you try this in Unified, we will throw an exception (since one of them won't be called).
We are trying to verify this issue, but we are not sure about the steps to verify.
Could you please share steps or small sample to reproduce/check this issue? So that we can verify it efficiently.
@John Miller - It appears we had two issues at play here. Rajneesh was correct in that we didn't verify that the general fix for delegate/event issues fixed this specific issue. Apologies.
It appears SelectionShouldChange incorrectly defaults to returning false instead of true.
You can work around this via adding:
tableView.SelectionShouldChange += (t) => true;
if you use the events.
Fixed in master / ceb756abed2250ebbbb0c9061c10c4edede96815. This will be available in XM 2.2, later this year.
QA - Open the mac-samples / NSOutlineViewAdnTableViewExampel and in NSTableViewExample.cs change
If the fix works, you'll be able to change selection in the table view tab.
Created attachment 13884 [details]
This feature has been completed and merged as you can see the trello card.
I have tested it may times and it is working fine at my end, I have attached test sample.
This issue has been fixed and working fine, hence I am closing this issue.