Clear Filters
Clear Filters

how can i reset of uitable, then again edit ?

1 view (last 30 days)
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 ?

Accepted Answer

Walter Roberson
Walter Roberson on 15 Dec 2017
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));

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!