What I would like to achieve is something like this:
DevExpress Grid
Table with fixed columns
The table at the above links can have "fixed" columns, which does not scroll with the other content.
I'm aware of NSTableView
's floatsGroupRows
feature, and of NSScrollView
's addFloatingSubview:forAxis:
method; but to achieve the above one, these are not enough:
- The columns are not
NSView
s, first of all - The table header and the table content is placed into 2 separate
NSClipView
s under theNSScrollView
(this is the default operation ofNSTableView
)
So as long I could not find any built in solution for this. My only idea was to use 3 NSTableView
s next to each other (+1 for the Left side, +1 for the right side); and sync the vertical scrolling in them manually. How to sync the horizontal scrolling, now that's a harder question. The Left and Right sides should not scroll, so should "float". For the table's content, the (*); but the column headers are different animals. Ok, there still should be a way to achieve this floating behavior via hacking the drawing of the columns...NSScrollView
's addFloatingSubview:forAxis:
method should work IMO
But still, I did not start to implement the above one, because my NSTableView
is slow enough already (NSTableview View Based Scrolling Performance), and I'm sure these plus things would slow it down horribly.
Has anyone any (better) idea how to achieve floating columns in Cocoa? Any help much appreciated!
Edit
(*): NSScrollView
's addFloatingSubview:forAxis:
does not work for this. As I see it now, if the NSView
given to this method is a subview of an NSTableView
, it gets special treatment. Probably the table adds its own logic into; and it turned out now for me, that the NSTableView
only can have 1 floating row at a time.