Borrar filtros
Borrar filtros

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

13 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by