Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > "selecting" nstableheadercells

"selecting" nstableheadercells
Thread Tools
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Dec 2, 2001, 03:01 PM
 
hi everybody,

might be i just don't see the obvious anymore, but i can't find it... how do i highlight a header cell for a table to give visual feedback, that e.g. entries in the table are sorted according to the highlighted column...?

i can catch clicks on it by becoming a delegate for the tableview, i know. but that doesn't "select" it.

any hints?
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
Dec 5, 2001, 01:02 AM
 
[tableView setAllowsColumnSelection:YES];

There should be a checkbox for that in the IB inspector too.
     
seb2  (op)
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Dec 5, 2001, 07:49 AM
 
hmm, that allows me to select the column but it doesn't highlight its headercell.

even if i set its headercell's state to nsonstate or call its highlight:YES... nothing.

lindberg, you've been of so much help to me before with tables, could you please give me one more clue?
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
Dec 5, 2001, 08:08 PM
 
Originally posted by seb2:
<STRONG>hmm, that allows me to select the column but it doesn't highlight its headercell.</STRONG>
That's ...odd. You mean you click on the column but its header cell stays gray like the others instead of turning blue? Or are you trying to do this programmatically?

If it's programmatically, you could use the -setHighlightedTableColumn: method just to highlight that table header (leaving a row selection) or the -selectColumn:byExtendingSelection: method to set the selected column.
     
seb2  (op)
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Dec 6, 2001, 01:21 AM
 
i've tried both, turning it on programmatically and -- well, not programmatically.

please believe me that i had thoroughly read nstableview's documentation before just posting my question here, but i must have missed setHighlightedTableColumn: every single time.

it works, thank you so much lindberg, you're my hero!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:18 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2