Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
bind infragistics hierarchical wingrid data from list at runtime only for export
posted

Hi,

Need a suggestion to bind hierarchical  win grid data from list at runtime only for exporting to excel.

Infragistics version we are using is 13.1

Thank in advance.Any help would be highly appreciated with a working example.

Parents
No Data
Reply
  • 48586
    posted

    Hello ,

     

    You should structure your classes hierarchy like:

     

    private void Form1_Load(object sender, EventArgs e)
            {
                A a = new A {Id = 1};
                B b = new B {Name = "b1", ParId = 1};
                a.Coll = new BindingList<B>{b};

                ultraGrid1.DataSource = new BindingList<A> { a };

                B b2 =new B{Name = "b2", ParId = 1};
                B b3 = new B { Name = "b3", ParId = 1 };
                a.Coll.Add(b2);
                a.Coll.Add(b3);
            }

            public class B
            {
                public int ParId { get; set; }
                public string Name { get; set; }
            }

            public class A
            {
                public int Id { get; set; }

                public BindingList<B> Coll { get; set; }
            }

     

    Please let me know if you have any further questions.

Children