how can I modify uitable cells

2 vues (au cours des 30 derniers jours)
natanel
natanel le 27 Déc 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'});

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 27 Déc 2012
Modifié(e) : Azzi Abdelmalek le 27 Déc 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.

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by