diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index dfa0df8c..5b5492d5 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -137,7 +137,11 @@ namespace Volian.Controls.Library //check for cell format changes 4th if (checkFormat && GetCellFormatString(XdNew) != GetCellFormatString(XdOld)) return true; - //check for merged cells 5th + //check for text alignment changes 5th + // put check in for bug fix B2014-106 + if (checkFormat && GetCellTextAlignString(XdNew) != GetCellTextAlignString(XdOld)) + return true; + //check for merged cells 6th if (GetCellMergeString(XdNew) != GetCellMergeString(XdOld)) return true; return false; @@ -262,6 +266,25 @@ namespace Volian.Controls.Library return string.Empty; return xd.SelectSingleNode("C1FlexGrid/MergedRanges").InnerXml; } + private string GetCellTextAlignString(XmlDocument xd) + { + // Note that I could not save (and later compare) the entire Definition string + // because the xml for the old and new table was always different. + // The old xml table data would have, for example "white" for the background color, while + // the new xml table data would have "255,255,255" for the background color. + // Therefore this check is specific for only the TextAlign setting - jsj 9-30-2014 + XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Styles/Style/Definition"); + string data = string.Empty; + foreach (XmlNode xn in nl) + { + string str = xn.InnerText; + string[] splStr = str.Split(';'); + foreach (string s in splStr) + if (s.StartsWith("TextAlign:")) + data += "|" + s; // only save the TextAlign setting + } + return data; + } private static GridCopyInfo _MyCopyInfo; public static GridCopyInfo MyCopyInfo {