MATLAB Answers

0

I want to have a popup menu as column format on a uitable and the popup list will be feeded by a variable. Is this possible?

Asked by Kelly Kyriakou on 13 Jul 2015
Latest activity Commented on by Kelly Kyriakou on 13 Jul 2015
I have a uitbale with 6 columns. I want to have a popup menu as column format at 5th column at the uitable and the popup list will be feeded by a variable. Is this possible?

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 13 Jul 2015
 Accepted Answer

uitable() cannot read the current content of a variable to determine the popup menu to display. You need to set() the appropriate entry of the uitable ColumnFormat property to the cell array of strings that you want to use for the popup entries each time the variable changes.
popup_column = 7; %for example
col_fmt = get(MyUitable, 'ColumnFormat');
col_fmt{popup_column} = Variable_with_new_entries
set(MyUitable, 'ColumnFormat', col_fmt);

  4 Comments

Show 1 older comment
set(handles.uitable3, 'columneditable', [true,true,true,true,true,true])
Also, you just might need to set() that after each time you change ColumnFormat
When you specify fewer logical values than there are columns, the remaining columns are assumed to be false (not editable)

Sign in to comment.