Is it possible to have different type of elementes on different rows on a uitable?
3 ビュー (過去 30 日間)
古いコメントを表示
I have an uitable and I need to have different types of elemnts on the rows that belong to the same column, how can I do this? Matlab only allows me to have ONE element type for the whole column. Also, is it possible to let the user modify some rows and some others no? Currently I am able to set this 'editable' option only for the columns, no for each specific row. Thanks!
0 件のコメント
回答 (1 件)
Walter Roberson
2015 年 12 月 14 日
In order to do those things you would need to go in at the Java level; MATLAB does not offer that level of control.
The most common way to handle mixed formats in a single column is to convert the column to string while it is in the uitable(), and converting the strings to appropriate numeric form if needed for computation.
A potential work around to prevent editing some rows would be to use a CellSelectionCallback, and if you detected that a logically read-only row was selected then to change the selection (even if it requires making the active object something else.) You cannot write into something you effectively cannot select.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!