Discussion:
how to add/remove button to a cell in tableview
Abhijeet Singh
2011-05-03 12:01:58 UTC
Permalink
Hi,There are four columns in my table view. The last column is empty. At run time I want to add a button to the last column depending upon a condition. If a condition is true for a row, button should be added (appeared) to the last column of the row. If condition is not true any more for a row the button should be removed from the last column of the row. I have used (NSCell *tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIt adds the button but i am not able to remove it from the cell. Thanks & RegardsAbhijeetDear macosxdev ! Get Yourself a cool, short @in.com Email ID now!
Abhijeet Singh
2011-05-03 12:04:20 UTC
Permalink
Hi,There are four columns in my table view. The last column is empty. At run time I want to add a button to the last column depending upon a condition. If a condition is true for a row, button should be added (appeared) to the last column of the row. If condition is not true any more for a row the button should be removed from the last column of the row. I have used (NSCell *tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIt adds the button but i am not able to remove it from the cell. Thanks & RegardsAbhijeetDear macosxdev ! Get Yourself a cool, short @in.com Email ID now! Dear macosxdev ! Get Yourself a cool, short @in.com Email ID now!
Christiaan Hofman
2011-05-03 12:08:16 UTC
Permalink
This is the delegate method you should be using. I am not sure what you mean when you say that "i am not able to remove it from the cell". You don't remove "it" from any cell, you just use a different cell.

Christiaan

Loading...