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
1170
Binding a composite object to UltraWingrid
posted

Hi,

I have a class like the following 

class MyCompositeClass
    {
        private string property1 = "prop1";
 
        [DisplayName("Identifier")]
        public string Property1
        {
            get { return property1; }
            set { property1 = value; }
        }
        private string property2 = "Prop2";
 
        public string Property2
        {
            get { return property2; }
            set { property2 = value; }
        }
        private MyInnerClass innerClassObj = new MyInnerClass();
 
        public MyInnerClass InnerClassObj
        {
            get { return innerClassObj; }
            set { innerClassObj = value; }
        }
    }

class MyInnerClass
    {
        public MyInnerClass()
        {
            mystring = "sadf";
        }
 
        private string mystring = null;
 
        public string Mystring
        {
            get { return mystring; }
            set { mystring = value; }
        }
 
    }

i am binding a list of MyCompositeClass to the ultragrid like following

BindingList<MyCompositeClass> comp = new BindingList<MyCompositeClass> { new MyCompositeClass() ,new MyCompositeClass()};
            ultraGrid1.DataSource = comp;

Can I show the public properties of MyInnerClass in the same band as the MyCompositeClass in some straightforward way?