Results 1 to 2 of 2

Thread: Binding a form to a PropertyGrid

  1. #1
    Join Date
    Jan 2009
    Posts
    2,404
    Rep Power
    0

    Default Binding a form to a PropertyGrid

    How can I go about inserting a Windows form as a data type for a PropertyGrid? The form will be used to edit data in a collection, but I don't want to use the default editor, which keeps popping up.

    This is the class that brings the default collections editor (templated from CodeProject); I presume it's the CollectionBase that implements the editor:
    Code:
    class FieldList : CollectionBase
    	{
    		public CustomField this [ int index ]
    		{
    			get
    			{
    				return ( CustomField ) List [ index ];
    			}
    		}
    
    		public void Add( CustomField field )
    		{
    			List.Add( field );
    		}
    
    		public void Remove( int target )
    		{
    			List.RemoveAt( target );
    		}
    	}
    Here is the property that the PropertyGrid uses to bind:
    Code:
    private FieldList fields;
    		[Category( "UserFields" )]
    		[DisplayName( "Fields" )]
    		[Description( "Fields created by the user." )]
    		public FieldList Fields
    		{
    			get
    			{
    				return fields;
    			}
    
    			set
    			{
    				fields = value;
    			}
    		}
    But binding the editor to my data is a bit complicated, and I also have to do it by a specified method; a user form to manipulate the data. I already have the form. My issue is replacing the default editor with it...
    Last edited by Skele Drew; May 13, 2009 at 11:07 AM.
    Rooted OnePlus 2 64GB Ed, Android 5.1.1 OxygenOS ; on teifin' AT&T's network; Rooted ASUS Transformer TF101 w/ dock, Android 5.1 KatKiss; Laptop: ASUS X550C, 2.0GHzx2, 8GB, 512GB SSD, Kubuntu 15.10;
    Facebook page: Skeleville Technology Solutions

  2. #2
    Join Date
    Oct 2006
    Posts
    136
    Rep Power
    0

    Default

    never seen that forms can be bounded to propertygrids.
    Where there is a will there is a way

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •