Fixed FlexGrid glitch that was causing the Column Count to be missing. The code has been changed so that the glitch will not cause a failure.
This commit is contained in:
parent
8f6fae12af
commit
08b0b27c64
@ -146,8 +146,8 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
string defCW = xd.SelectSingleNode("C1FlexGrid/ColumnInfo/DefaultSize").InnerText;
|
string defCW = xd.SelectSingleNode("C1FlexGrid/ColumnInfo/DefaultSize").InnerText;
|
||||||
string defRH = xd.SelectSingleNode("C1FlexGrid/RowInfo/DefaultSize").InnerText;
|
string defRH = xd.SelectSingleNode("C1FlexGrid/RowInfo/DefaultSize").InnerText;
|
||||||
int cols = int.Parse(xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count").InnerText);
|
int cols = ColumnCount(xd);
|
||||||
int rows = int.Parse(xd.SelectSingleNode("C1FlexGrid/RowInfo/Count").InnerText);
|
int rows = RowCount(xd);
|
||||||
List<string> rh = new List<string>();
|
List<string> rh = new List<string>();
|
||||||
for (int i = 0; i < rows; i++)
|
for (int i = 0; i < rows; i++)
|
||||||
rh.Add(defRH);
|
rh.Add(defRH);
|
||||||
@ -182,10 +182,36 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return rhcw;
|
return rhcw;
|
||||||
}
|
}
|
||||||
|
private int ColumnCount(XmlDocument xd)
|
||||||
|
{
|
||||||
|
XmlNode xn = xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count");
|
||||||
|
int cols = 0;
|
||||||
|
if (xn != null)
|
||||||
|
cols = int.Parse(xn.InnerText);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Columns/Column");
|
||||||
|
cols = nl.Count;
|
||||||
|
}
|
||||||
|
return cols;
|
||||||
|
}
|
||||||
|
private int RowCount(XmlDocument xd)
|
||||||
|
{
|
||||||
|
XmlNode xn = xd.SelectSingleNode("C1FlexGrid/RowInfo/Count");
|
||||||
|
int rows = 0;
|
||||||
|
if (xn != null)
|
||||||
|
rows = int.Parse(xn.InnerText);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Rows/Row");
|
||||||
|
rows = nl.Count;
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
private string GetCellDataString(XmlDocument xd)
|
private string GetCellDataString(XmlDocument xd)
|
||||||
{
|
{
|
||||||
int cols = int.Parse(xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count").InnerText);
|
int cols = ColumnCount(xd);
|
||||||
int rows = int.Parse(xd.SelectSingleNode("C1FlexGrid/RowInfo/Count").InnerText);
|
int rows = RowCount(xd);
|
||||||
List<string> datum = new List<string>();
|
List<string> datum = new List<string>();
|
||||||
for (int i = 0; i < rows * cols; i++)
|
for (int i = 0; i < rows * cols; i++)
|
||||||
datum.Add("|");
|
datum.Add("|");
|
||||||
@ -208,8 +234,8 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private string GetCellFormatString(XmlDocument xd)
|
private string GetCellFormatString(XmlDocument xd)
|
||||||
{
|
{
|
||||||
int cols = int.Parse(xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count").InnerText);
|
int cols = ColumnCount(xd);
|
||||||
int rows = int.Parse(xd.SelectSingleNode("C1FlexGrid/RowInfo/Count").InnerText);
|
int rows = RowCount(xd);
|
||||||
List<string> datum = new List<string>();
|
List<string> datum = new List<string>();
|
||||||
for (int i = 0; i < rows * cols; i++)
|
for (int i = 0; i < rows * cols; i++)
|
||||||
datum.Add("|");
|
datum.Add("|");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user