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
230
Bind TList to hierarchical grid
posted

Hi,

So far, i have seen samples that shown hierarchical ultrawebgrid bind by dataset (using data relation).

How do i bind TList to hierarchical grid and how do i set the relation?

I'm using code smith generated code. any ideas?

Thanks! 

 

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    This is easy as well - just make sure you have something similar to this (the child collection needs to be a TList as well)

    public class Docs
    {
        public string Name { get; set; }
    }

    public class Budget
    {
        public string BName { get; set; }
        public List<Docs> Dox { get; set; }
    }

     

    this.UltraWebGrid1.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.Hierarchical;
            List<Budget> list = new List<Budget>();

            Budget b1 = new Budget() { BName = "1999", Dox = new List<Docs>() };
            list.Add(b1);

            Budget b = new Budget() { BName = "2000", Dox = new List<Docs>() };
            Docs d = new Docs() { Name = "Bob" };
            b.Dox.Add(d);

            list.Add(b);
            this.UltraWebGrid1.DataSource = list;
            this.UltraWebGrid1.DataBind();

     

    For more information, please take a look at the following forum thread:

    http://forums.infragistics.com/forums/t/18040.aspx

Children
No Data