Is it possible to have different type of elementes on different rows on a uitable?

3 visualizaciones (últimos 30 días)
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!

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Dic. de 2015
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.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by