MATLAB: How to have ‘dropdown’ in every cell of a table in App Designer

appchoicedesignerdropdownMATLABoptionselecttableuitable

The requirement is having a drop down menu embedded in each row of the table to select from multiple options. We know that we can use checkboxes in the table but that will expand the table vertically which would result in lots of scrolling for the user. We also know that UITable in App designer does not have any children.

Best Answer

Yes, UITable is a leaf component and does not have any child. The 'Data' property is the only property to set tabular data in UITable. Currently drop down menus in UITable is supported using the 'ColumnFormat' property.
In the App Designer startup function:
app.UITable.Data = {'female';'male';'male'}; % have 3 rows of gender information.
app.UITable.ColumnFormat = {{'male', 'female'}}; % have option cell array within ColumnFormat property to indicate the 1st column is using dropdown menus.
app.UITable.ColumnEditable = true;
More information can be found in UITable 'ColumnFormat' property in MATLAB Documentation