Clear Filters
Clear Filters

How can I add DropDown Menus in multiple Cells of a particular Column in a UITable in App Designer?

13 views (last 30 days)
I was able to populate the data into the UITable, but I want to make a column editible by placing a dropdown in a cell with three options/items within the dropdown and the amount of data within the UITable varies. I don't want to make multiple app.___DropDown to be inserted in each cell, but the same app component within each cell. I don't know if it's possble, but please let me know or if there is a UITable property that makes the cells of particular column in DropDown menus without having to do anything super complex.

Accepted Answer

Voss
Voss on 22 Aug 2023
Yes, you can set the ColumnFormat of that column to a cell array containing the dropdown items. The same items will appear in all dropdowns in that column of the uitable.
For example:
col_format = {'numeric' {'Yes' 'No'} 'numeric'};
data = {1 'Yes' 3; 11 'No' 6.5; 7.77 'No' 9; 10 'Yes' 12.13};
t = uitable( ...
'Data',data, ...
'ColumnFormat',col_format, ...
'ColumnEditable',true(1,size(data,2)));
  3 Comments
Sean
Sean on 23 Aug 2023
I was able to figure it out, thank you for your help.
app.UITable.ColumnFormat = {'numeric' {'yes' 'no' 'maybe'} 'logical'};
Thank you!

Sign in to comment.

More Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!