필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
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
Debasish Samal
Debasish Samal 2020년 11월 13일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by