Borrar filtros
Borrar filtros

When creating a UiTable and trying to display a pop-up menu in a cell, the point down arrow does not appear.

5 visualizaciones (últimos 30 días)
I am trying to create a drop down menu with different options in a cell for UITable. But when the GUI appears the cell looks exactly as the others and only when i double click it the option menu (and the down arrow) appears.
My code is:
d = {'LogStart', 0.2, 'Log End', 800, 3000};
ColumnNames = {'BGGas top Zone name', 'BGGas value %',...
'BGGas base zone name', 'BGGas top zone depth',...
'BGGas base zone depth'};
zones = {'LogStart', 'Neogene', 'Paleogene', 'Cretaceous', 'Jurassic',...
'Triassic', 'Permian', 'Carboniferous', 'Devonian', 'Silurian',...
'Ordivician', 'Cambrian'};
fig = uifigure('Name', 'Enter Background Gas Value',...
'CloseRequestFcn',@Parent_closefcn);
%-------Table------
uit = uitable(fig);
uit.Position(1:2) = [10,150];
uit.Position(3:4) = [fig.Position(3)-20, fig.Position(4)-220];
uit.ColumnSortable = false;
uit.RowName = 'numbered';
uit.ColumnName = ColumnNames;
uit.Data = d;
uit.ColumnFormat = {zones, 'numeric', 'char', 'numeric', 'numeric'};
uit.ColumnEditable = [true true false false false true];
When running my code my GUI looks like this:
And when double clicking:
Any idea why the drop down menu arrow is not appearing?
Thank you in advance.
  2 comentarios
Debasish Samal
Debasish Samal el 13 de Nov. de 2020
Hi Alejandro!
As far as I know, you have to click once on the particular cell you want to edit and click a second time for the drop down menu to appear and select an option from the menu.
I found an answer with a workaround which might help you here. Please refer to the MATLAB Answer below:
I have not tried it myself. Please try and see if it works for you.
Thanks.
-Debasish

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by