Effacer les filtres
Effacer les filtres

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

13 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

Voss
Voss le 22 Août 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 commentaires
Sean
Sean le 23 Août 2023
I was able to figure it out, thank you for your help.
app.UITable.ColumnFormat = {'numeric' {'yes' 'no' 'maybe'} 'logical'};
Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by