how can i reset of uitable, then again edit ?

2 次查看(过去 30 天)
i have made a uitable, i will give number, then i use this number to calculation. i use a pushbutton for reset this table, but after reset, i cant't enter the new value.
this code :
function Reset_Geometry_Callback(hObject, eventdata, handles)
set(handles.Geometry_Busbar,'Data',[]);
set(handles.Geometry_Busbar,'ColumnEditable',true);
then i want to enter new value, there is a warning :
Warning: Table data is not editable at this location.
anyone can help me ?

采纳的回答

Walter Roberson
Walter Roberson 2017-12-15
set(handles.Geometry_Busbar,'Data',[]);
Instead of setting it to [], set it to a cell with as many columns as there are columns in the uitable
set(handles.Geometry_Busbar,'ColumnEditable',true);
Instead of setting it to a single true, set it to a vector of as many true as there are columns in the uitable.
ncols = 7;
set(handles.Geometry_Busbar, 'Data', cell(1, ncols));
set(handles.Geometry_Busbar, 'ColumnEditable', true(1,ncols));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by