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!