Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Unbound NestedGrid

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
Link Posted: 29-May-2007 21:53
Hi I need unbound nested grid with different column set. Cant get how to do so.

Just to make it clear.

I need master row with columns 1 2 3 and nested rows with columns 4 5 for example.

I saw it working in your example for bound data tables with relations.

But I use bare objects. Test code is here:


// master has 4 columns (include hierarchicalColumn) and details have 1 column.
for (int i = 0; i < 5; i++)
{
    flyGrid1.Rows.Items.Add(new Node(new object[] { null, null, null, i }));
    flyGrid1.Rows.Items[flyGrid1.Rows.Items.Count - 1].Items.Add(new Node(new object[] { i + 100 }));
}
Link Posted: 31-May-2007 02:32
Yes, it is possible, in this case you should add children to the master row (node):
[c#]
NestedGridNode masterNode = new NestedGridNode(new object[] { null, null, 5, \"Some Data\" });
//add nested nodes
for(int i = 0; i < 5; i++)
{
  NodeBase child = new Node(new object[] { null, null, \"Some Child Data\", i });
  masterNode.Add(child);
}

But don't forget to add nested columns to your grid to correctly display nested nodes.
Link Posted: 31-May-2007 21:29
Thank you for the prompt answer. I tried this code and it doesnt work with 1.5.0 Pro version.

I installed evaluation from \"Downloads\" section on the website which says \"1.5.2.0\" but dlls in fact are 1.5.0.31963 and NestedGridNode has only default constructor and has no Add.

P.S......................................

        public Form2()
        {
            InitializeComponent();

            this.numberColumn2 = new NineRays.Windows.Forms.Grids.NumberColumn();
            this.numberColumn2.Caption = \"Child\";
            this.numberColumn2.ImageKey = null;
            this.numberColumn2.NumberType = System.TypeCode.Int32;

            flyGrid1.Columns.NestedColumns.Items.Add(numberColumn2);

            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 Node(new object[] { i });
            }
            master.Items.AddRange(children);

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


I have got some result by now. I can see 'details' view separately but...

1. In child column I see \"NineRays.Windows.Forms.Data.Node\" instead of number

2. I dont see headers in children view

3. Is there any way I can add nested columns in designer mode? Copy/paste code for every column quite a boring activity
Link Posted: 31-May-2007 21:54
children[i].Value = new object[] { i };

Have found an answer for question 1 myself

But questions 2 and 3 still are valid ..

Having deadline soon need to press on!
Link Posted: 31-May-2007 22:35
I had answered 2nd question in different thread

Master node must be of NestedGridNode type as well !