Click here to Skip to main content
15,893,668 members
Articles / Programming Languages / C#

Nested Property Binding

Rate me:
Please Sign up or sign in to vote.
4.99/5 (41 votes)
12 Sep 2007CPOL7 min read 182.2K   3K   95  
Extending the BindingSource component to support nested property binding
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Text;

namespace System.Core.ComponentModel
{
    public class CustomPropertyAttribute : Attribute
    {
        private PropertyDescriptor _propertyDescriptior;
        private string _propertyPath;
        private Type _rootType;


        public CustomPropertyAttribute(Type rootType,string propertyPath, PropertyDescriptor propertyDescriptor)
        {
            _rootType = rootType;
            _propertyPath = propertyPath;
            _propertyDescriptior = propertyDescriptor;                    
        }


        public PropertyDescriptor PropertyInfo
        {
            get { return _propertyDescriptior; }
        }

        public string PropertyPath
        {
            get { return _propertyPath; }
        }

        public Type RootType
        {
            get { return _rootType; }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Norway Norway
I'm a 39 year old software developer living in Norway.
I'm currently working for a software company making software for the retail industry.

Comments and Discussions