diff --git a/PROMS/Volian.Controls.Library/GridItem.cs b/PROMS/Volian.Controls.Library/GridItem.cs index 09f8633b..47b45d9b 100644 --- a/PROMS/Volian.Controls.Library/GridItem.cs +++ b/PROMS/Volian.Controls.Library/GridItem.cs @@ -537,7 +537,8 @@ namespace Volian.Controls.Library { Focus(); MyFlexGrid.Focus(); - MyFlexGrid.Select(0, 0); + if (!MyFlexGrid.IsRoTable) // Table ROs are none editable - don't select a table cell + MyFlexGrid.Select(0, 0); } else { @@ -576,10 +577,13 @@ namespace Volian.Controls.Library int sl = MyStepRTB.SelectionLength; MyFlexGrid.StartEditing(); MyStepRTB.Select(ss, sl); // need to reset selection because startediting positions to end. - string oldRtf = MyStepRTB.Rtf; - DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; + if (!MyStepRTB.ReadOnly) + { + string oldRtf = MyStepRTB.Rtf; + DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); + if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; + if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; + } } c = c + 1; if (c == w) @@ -605,10 +609,13 @@ namespace Volian.Controls.Library int sl = MyStepRTB.SelectionLength; MyFlexGrid.StartEditing(); MyStepRTB.Select(ss, sl); - string oldRtf = MyStepRTB.Rtf; - DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; + if (!MyStepRTB.ReadOnly) + { + string oldRtf = MyStepRTB.Rtf; + DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); + if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; + if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; + } } c = c - 1; if (c < 0) diff --git a/PROMS/Volian.Controls.Library/StepTabPanel.cs b/PROMS/Volian.Controls.Library/StepTabPanel.cs index 9157e8b8..f946948c 100644 --- a/PROMS/Volian.Controls.Library/StepTabPanel.cs +++ b/PROMS/Volian.Controls.Library/StepTabPanel.cs @@ -86,7 +86,8 @@ namespace Volian.Controls.Library grd.SetSearchCell(SearchString); } // convert the '-' to the unicode non-breaking dash (\u8209? or \u2011 hex) - SelectedEditItem.MyStepRTB.Find(SearchString.Replace('-','\u2011')); + if (!SelectedEditItem.MyStepRTB.IsRoTable) + SelectedEditItem.MyStepRTB.Find(SearchString.Replace('-','\u2011')); } #endregion #region Contructors diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 0bd8c286..64b564c7 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1828,7 +1828,7 @@ namespace Volian.Controls.Library public void SetRibbonForGrid() { // set to true if editing cell, otherwise false for grids - bool enable = (MyFlexGrid.Editor != null); + bool enable = (MyFlexGrid != null && MyFlexGrid.Editor != null); btnPaste.Enabled = enable; btnCopy.Enabled = enable; btnCut.Enabled = enable; diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index 3c4409ef..fa1a0688 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -3827,6 +3827,7 @@ namespace Volian.Controls.Library public void StartEditing(int row, int col) { _initializingEdit = true; + ReadOnly = IsRoTable; // save coordinates of cell being edited _row = row; _col = col; @@ -3841,7 +3842,7 @@ namespace Volian.Controls.Library // initialize control content Text = ""; FindAllLinks(); // jsj 1-5-2011 - if (_pendingKey > ' ') + if (_pendingKey > ' ' && !ReadOnly) Text = _pendingKey.ToString(); else if (_owner[row, col] != null) {