Making uitable's particular cell uneditable.

4 ビュー (過去 30 日間)
sermet
sermet 2013 年 12 月 17 日
コメント済み: Walter Roberson 2013 年 12 月 17 日
% I know how to make uneditable any column in uitable but when it comes to particular cell, I wonder that is that possible to set uneditable any cell in uitable.
%let say that,
%I placed blank uitable in GUI, and assigned zeros(3,3) into this uitable with set(handles....)
%1*3 cell needs to be uneditable when I run the codes while others are editable.
%I desperately need to know that is that possible or not in Matlab?

採用された回答

Walter Roberson
Walter Roberson 2013 年 12 月 17 日
At the MATLAB level, all you can do is keep a memory of what the cell should contain, and then when you detect that the user is trying to edit the cell, set the cell back to the value it should be.
You might be able to do something at the Java level. Those facilities are undocumented. I recommend you look at http://undocumented-matlab.com
  2 件のコメント
sermet
sermet 2013 年 12 月 17 日
dear Walter, could you give an example for your solution with codes? I couldn't understand it exactly.
Walter Roberson
Walter Roberson 2013 年 12 月 17 日
Set the CellEditCallbackFcn property of the uitable to a routine you create. In that routine, detect whether the cell of interest has been edited compared to what it should be. If it has, then change the Data property of the uitable so as to set the cell back to what you want it to be.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by