how can I modify uitable cells

3 visualizaciones (últimos 30 días)
natanel
natanel el 27 de Dic. de 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'});

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 27 de Dic. de 2012
Editada: Azzi Abdelmalek el 27 de Dic. de 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.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by