B2018-127 Use the row and column from the merged cells range to update a selected table cell.

This commit is contained in:
John Jenko 2018-09-14 14:06:04 +00:00
parent d2a442e385
commit 1d113b519d

View File

@ -1285,6 +1285,7 @@ namespace Volian.Controls.Library
IsSaving = true; IsSaving = true;
if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0 && MyStepRTB.EditMode) // Only if a Cell is Selected if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0 && MyStepRTB.EditMode) // Only if a Cell is Selected
{ {
CellRange cr = MyFlexGrid.GetMergedRange(MyFlexGrid.Selection.r1, MyFlexGrid.Selection.c1); // B2018-127 get merged range
int row = MyFlexGrid.Row; int row = MyFlexGrid.Row;
int col = MyFlexGrid.Col; int col = MyFlexGrid.Col;
//SaveContents(); //SaveContents();
@ -1293,7 +1294,7 @@ namespace Volian.Controls.Library
DoNotRefresh = false; DoNotRefresh = false;
MyFlexGrid.Row = row; MyFlexGrid.Row = row;
MyFlexGrid.Col = col; MyFlexGrid.Col = col;
MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col] = MyStepRTB.Rtf; MyFlexGrid[cr.r1, cr.c1] = MyStepRTB.Rtf; // B2018-127 this saves to the first cell in a merged range
} }
if (!MyFlexGrid.IsDirty) return; if (!MyFlexGrid.IsDirty) return;
SaveContents(); SaveContents();