MATLAB Answers

UITable.Ro​wName='num​bered'; does not work since upgrade to v2021

5 views (last 30 days)
PD on 10 Jun 2021
Answered: PD on 14 Jun 2021
Just updated to matlab v2021.
The UITable control does not seem to dispaly the table index. It worked without issues in previous releases.
The RowName propery is set to 'numbered' in the App Designer:
At runtime, if i insert a breakpoint before the table is being refreshed and manually edit the value for RowName (retype the word numbered) the index shows up.
Thank you in advance for any suggestions.

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 10 Jun 2021
The 'numbered' option still works in R2021a when I test it using the two examples below (which could be added to your app's startup function) and the 'numbered' option also works when I define "RowName" in AppDesigner>Design Mode as numbered (without quotes).
Are you getting an error? If not, what do your row names look like?
Is there another part of your app that interacts with the uitable?
T = array2table(rand(5,4));
uif = uifigure();
uit =uitable(uif, 'data',T,'RowName','numbered')
T = array2table(rand(5,4));
uif = uifigure();
uit =uitable(uif, 'data',T)
uit.RowName = 'numbered'
Adam Danz
Adam Danz on 12 Jun 2021
When I try that in app designer (r2021a) I don't have any problems.
Have you tried setting RowName to numbered within DesignView (and then removing the RowName line from the startup function)(see below)?
If that doesn't work, please attach the app and instruction to produce the table, if needed. You may need to attach the app in a zip file, I forget if mlapp attachments are allowed.

Sign in to comment.

More Answers (1)

PD on 14 Jun 2021
After trying all the combinations that i could think of, I left the all the fields empty in the component browser (exempt auto for ColumnWidth).
Then i noticed that there were two instances of app.UITable.RowName = 'numbered'; (startupFcn+ user function). Leaving just one instance solved the problem.
The issue seems to arise in v2021 when using code from previous versions. Multiple calls to RowName method apper to affect the indices.
Thank you all for your helpful suggestions.




Community Treasure Hunt

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

Start Hunting!