Christoffer Reijer
Christoffer Reijer

Reputation: 1995

Highlight row of NSOutlineView

I have a project in MonoMac/Xamarin.MAc written in C#. In it I have a custom class derived from NSOutlineView which shows a context menu for some items. By doing it this way instead of just assigning the Menu property (which would show a context menu for every item) I lose the blue border which appears around the row when you right-click an item (I call it a highlight, as opposed to a selection which is a solid blue). You can see this in action by right-clicking any item in the sidebar in the Finder window.

Is there a way to programmatically highlight a certain row of an NSOutlineView? Note that the actual selection is still left intact.

Thanks!

Upvotes: 1

Views: 300

Answers (1)

Hussain Shabbir
Hussain Shabbir

Reputation: 15025

Try something like this:-

[outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:index] byExtendingSelection:YES];

Upvotes: 0

Related Questions