how can I modify uitable cells

2 visualizzazioni (ultimi 30 giorni)
natanel
natanel il 27 Dic 2012
Hi I need to be able to enter values in uitable cells (like in excel) but I don't find how to make the cells editable
this is my uitableMy_CreateFcn but still can not edit cells
UI_TABLE_EXCITATION_NUM_OF_LINES = 3;
UI_TABLE_EXCITATION_HEADERS = { 'aaa[W]','bbb[W]','ccc[gr]','ddd[gr]','eee[%]',...
'fff[%]','ggg[C]'};
% set header
set( hObject,'ColumnName', UI_TABLE_EXCITATION_HEADERS);
% set data
set( hObject,'data', cell(UI_TABLE_EXCITATION_NUM_OF_LINES, size(UI_TABLE_EXCITATION_HEADERS,2)));
% set cell format
set(hObject,'ColumnFormat',{'numeric' 'numeric' 'numeric' 'numeric' 'numeric' 'numeric' 'numeric'});

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 27 Dic 2012
Modificato: Azzi Abdelmalek il 27 Dic 2012
set(t,'ColumnEditable',logical(1))
Example
t = uitable;
set(t,'Data',ones(5,3))
set(t,'ColumnWidth',{100})
set(t,'ColumnEditable',logical([1 0 1]))
% the first and third column are editable , the second is not.

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by