From b9ce84342128cdafa985369342607cd51c95583c Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 17 Mar 2011 09:38:48 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/VlnFlexGrid.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index 2d75fd17..7b6fabea 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -957,7 +957,6 @@ namespace Volian.Controls.Library } // find the needed cell width trtb.AdjustWidthForContent(); - if (dummyCharWidth) { trtb.Text = ""; // clear out the dummy character before saving @@ -971,7 +970,6 @@ namespace Volian.Controls.Library // Now adjust the Height and Width in the defined merge ranges AdjustMergeRangeHeightWidth(r, c, trtb, tstr, AllowWidthShrink); - //// Now see the the selected row,col is in the defined merge ranges //bool mrgrows = false; //bool mrgcols = false; @@ -1112,9 +1110,8 @@ namespace Volian.Controls.Library if (!mrgcols) { // add adjustment for grid and cell borders - int newwidth = trtb.Width + 2; - - if (newwidth > (this.Cols[c].Width==-1?this.Cols.DefaultSize:this.Cols[c].Width) || AllowWidthShrink || r == 0) + int newwidth = trtb.Width + 3; // 2; + if (newwidth > (this.Cols[c].Width == -1 ? this.Cols.DefaultSize : this.Cols[c].Width) || AllowWidthShrink || r == 0) this.Cols[c].Width = newwidth; } } @@ -1299,12 +1296,16 @@ namespace Volian.Controls.Library for (int c = 0; c < this.Cols.Count; c++) this.ConvertTextCellToRTF(r, c); } + //this.Refresh(); //Application.DoEvents(); this.AdjustGridControlSize(); + SetupCellUserData(); + //RemoveBlankSpaceFromColumns(); RemoveBlankSpaceFromRows(); + } public void FixTableCellsHeightWidth() @@ -2532,7 +2533,7 @@ namespace Volian.Controls.Library idx = -1; } } while (idx != -1); - maxRow = curRow + 1; + maxRow = curRow; // +1; curRow = 0; curCol = 0; // The resulting Table Grid size in rows and columns @@ -2549,7 +2550,6 @@ namespace Volian.Controls.Library for (int r = 0; r <= maxRow; r++) for (int c = 0; c <= maxCol; c++) tci[r, c] = new TableCellInfo(); - // Read in each cell of the grid idx = 0; idxst = 0; @@ -2704,7 +2704,7 @@ namespace Volian.Controls.Library { // find the curent column and merge remaining columns to the right colPos = idxst - strow; - curCol = dicCols[colPos]; + curCol = dicCols.Count==0?0:dicCols[colPos]; while (curCol > prevCol + 1) { tci[curRow, prevCol].MergeColRight = true;