Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Unbound NestedGrid. How to display details column headers.

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Unbound NestedGrid. How to display details column headers.
Link Posted: 31-May-2007 22:29
Decided to separate this question to another thread.

Here the full code I made same way as in your nestedGridForm.cs. But I cant see column headers in the nested grid.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NineRays.Windows.Forms.Data;
using NineRays.Windows.Forms.Grids;

namespace test1
{
    public class Form2 : Form
    {

        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        private NineRays.Windows.Forms.FlyGrid flyGrid1;

        private System.ComponentModel.IContainer components = null;

        public Form2()
        {
            #region InitializeComponent();

            this.flyGrid1 = new NineRays.Windows.Forms.FlyGrid();
            ((System.ComponentModel.ISupportInitialize)(this.flyGrid1)).BeginInit();
            this.SuspendLayout();
            //
            // flyGrid1
            //
            this.flyGrid1.Location = new System.Drawing.Point(12, 12);
            this.flyGrid1.Name = \"flyGrid1\";
            this.flyGrid1.Size = new System.Drawing.Size(268, 249);
            this.flyGrid1.Text = \"flyGrid1\";
            //
            // Form2
            //
            this.ClientSize = new System.Drawing.Size(292, 302);
            this.Controls.Add(this.flyGrid1);
            this.Name = \"Form2\";
            ((System.ComponentModel.ISupportInitialize)(this.flyGrid1)).EndInit();
            this.ResumeLayout(false);

            #endregion

            HierachyColumn hc = new HierachyColumn(\"H\");
            Column c1 = new Column(\"Master\");
            Column c2 = new Column(\"Details\");

            flyGrid1.Columns.Items.Add(hc);
            flyGrid1.Columns.Items.Add(c1);
            flyGrid1.Columns.NestedColumns.Items.Add(c2);

            Node master = new Node(new object[] { null, \"99\" });

            NestedGridNode[] children = new NestedGridNode[5];
            //add nested nodes
            for (int i = 0; i < 5; i++)
            {
                children[i] = new NestedGridNode();
                children[i].Value = new object[] { i.ToString() };
            }

            flyGrid1.Rows.RootNode.Items.Add(master);

            flyGrid1.Rows.Items[0].Items.AddRange(children);
        }

    }
}
Link Posted: 31-May-2007 22:33
Fixed this. My assumptions about NestedGridNode were wrong

            NestedGridNode master = new NestedGridNode();
            master.Value = new object[] { null, \"99\" };