B2026-003 Imported memory handling in the FlexGrid (table) code for when we are replacing many RO values in table cells
This commit is contained in:
@@ -272,21 +272,24 @@ namespace Volian.Controls.Library
|
||||
for (int i = 0; i < rows * cols; i++)
|
||||
datum.Add("|");
|
||||
XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data");
|
||||
string data = string.Empty;
|
||||
// B2026-003 use StringBuilder a "using" statement around the RichTextBox for better mememory management
|
||||
StringBuilder data = new StringBuilder();
|
||||
foreach (XmlNode xn in nl)
|
||||
{
|
||||
RichTextBox rtb = new RichTextBox();
|
||||
rtb.Rtf = xn.InnerText;
|
||||
XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute;
|
||||
string[] rc = xa.InnerText.Split(',');
|
||||
int r = int.Parse(rc[0]);
|
||||
int c = int.Parse(rc[1]);
|
||||
int index = r * cols + c;
|
||||
datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Text);
|
||||
using (RichTextBox rtb = new RichTextBox())
|
||||
{
|
||||
rtb.Rtf = xn.InnerText;
|
||||
XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute;
|
||||
string[] rc = xa.InnerText.Split(',');
|
||||
int r = int.Parse(rc[0]);
|
||||
int c = int.Parse(rc[1]);
|
||||
int index = r * cols + c;
|
||||
datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Text);
|
||||
}
|
||||
}
|
||||
foreach (string s in datum)
|
||||
data += s;
|
||||
return data;
|
||||
data.Append(s);
|
||||
return data.ToString();
|
||||
}
|
||||
private string GetCellFormatString(XmlDocument xd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user