4

How can I make a row non-editable, something similar to 'ColumnEditable'.

I searched for a solution and only one came up....it's to do with Java. Any other solutions?

Here is what I'm trying to do, and I'm already planning to change it! I have check boxes that will determine what are the inputs and thus the ones that are not ticked will be disabled in the table. enter image description here

I didn't expect this at all, I made the table and then went to the documentation expecting to find something like 'RowEditable'! If there is no easy solution, I will probably use 'static text' and 'edit text' which will either disappear or be disabled depending on the check boxes.

Andrey Rubshtein
  • 20,795
  • 11
  • 69
  • 104
abdulhaq-e
  • 626
  • 9
  • 19
  • 1
    I believe you cannot do it with MATLAB's uitable. I thought about using CellSelectionCallback function, but there are no methods to select/delecet a cell. You probably stuck with either java table or separate components. – yuk Mar 21 '12 at 06:05
  • 1
    Another solution is using ActiveX. To see how to use it, check out my answer in http://stackoverflow.com/questions/8853274/can-you-limit-what-characters-can-be-typed-into-a-matlab-gui-editbox/8854217#8854217. However, you will need to find the relevant ActiveX by yourself. – Andrey Rubshtein Mar 21 '12 at 08:31
  • 2
    Have you tried Setting 'Editable' to false as explained in http://undocumentedmatlab.com/blog/additional-uicontrol-tooltip-hacks/ ? – EwyynTomato Mar 21 '12 at 10:35
  • @EwyynTomato I tried it, `Editable` on works on `edittext'. Thanks for the link though. – abdulhaq-e Mar 24 '12 at 23:18
  • @Andrey I'm not using GUIDE, I can probably use ActiveX it without GUIDE but I don't want to go into it since the program will only work in Windows. Thanks for the suggestion. – abdulhaq-e Mar 24 '12 at 23:19
  • @yuk I decided to go with separate components. Thanks. – abdulhaq-e Mar 24 '12 at 23:20

1 Answers1

0

You should be able to set the "Enable" property of the text box to either Off or Inactive. Personally I'd favor setting it to off.

Off will slightly 'gray' out the cell and make it so the user cannot interact with it.

Inactive maintains the active coloring of the cell but still doesn't allow the user to interact with it.

This should easily be controlable from callbacks from the click options you already have in place.

Ben A.
  • 1,039
  • 6
  • 13