Exemplo n.º 1
0
        private void GetXMLData(XmlNode node, int level)
        {
            // skip comment nodes
            if (node.NodeType == XmlNodeType.Comment)
            {
                return;
            }

            // add new row for this node
            int row = flex.Rows.Count;

            flex.Rows.Add();
            flex[row, 0] = node.Name;
            if (node.ChildNodes.Count == 1)
            {
                flex[row, 1] = node.InnerText;
                flex.SetCellStyle(row, 1, flex.Styles["Data"]);
            }

            // make new row a node
            flex.Rows[row].IsNode     = true;
            flex.Rows[row].Node.Level = level;

            // if this node has children, get them as well
            if (node.ChildNodes.Count > 1)
            {
                // recurse to get children
                foreach (XmlNode child in node.ChildNodes)
                {
                    GetXMLData(child, level + 1);
                }
            }
        }
Exemplo n.º 2
0
 private void ClearRow(int row)
 {
     //This function clears a row of data, style and images, skipping the 0th column
     for (int i = 1; i < c1FlexGrid1.Cols.Count; i++)
     {
         c1FlexGrid1[row, i] = null;
     }
     c1FlexGrid1.SetCellStyle(row, devCol, c1FlexGrid1.Styles["Normal"]);
     c1FlexGrid1.SetCellImage(row, devCol, null);
 }