您好,我尝试了一下,没有直接的属性可以去实现您的需求。
两种变通的方式,
1. 可以进入编辑状态,但是无法输入。
2. 只要进入编辑状态就弹出,subEditor,一旦关闭subEditor,就退出编辑状态。
给人觉得第二中好一些。
- var subEditorForm = new Form2();
- txt.SubEditor = subEditorForm;
- fpSpread1.EditModeOn += FpSpread1_EditModeOn;
- subEditorForm.CloseUp += SubEditorForm_CloseUp;
- }
- private void SubEditorForm_CloseUp(object sender, EventArgs e)
- {
- fpSpread1.EditMode = false;
- }
- private void FpSpread1_EditModeOn(object sender, EventArgs e)
- {
- var ac = fpSpread1.ActiveSheet.ActiveCell;
- if(ac.CellType is TextCellType)
- {
- var ct = ac.CellType as TextCellType;
- if (ct.SubEditor != null)
- {
- //var ed = fpSpread1.EditingControl as GeneralEditor;
- //if (ed != null)
- //{
- // ed.ReadOnly = true;
- //}
- ct.ShowSubEditor();
- }
- }
- }
复制代码 |