Solved

Design Time: DatagridView Colums does not display the property provided by the extender

Posted on 2008-06-26
1
429 Views
Last Modified: 2013-12-16
Just as simple as that. The Test property is attached to controls, ListView columns, anything I want except for Columns (in Columns Collection Editor of a DataGridView). Why? Is there something I can do?

[ProvideProperty("Test", typeof(IComponent))]
        public partial class Component1 : Component, IExtenderProvider
        {
            private Dictionary<string, string> _commponentsIntlist = new Dictionary<string, string>();
 
            [Browsable(true)]
            [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
            public Dictionary<string, string> ComponentsAndStatefullProp
            {
                get { return _commponentsIntlist; }
                set { _commponentsIntlist = value; }
            }
            
            public Component1()
            {
                InitializeComponent();
            }
 
            public Component1(IContainer container)
            {
                container.Add(this);
                InitializeComponent();
            }
 
            bool System.ComponentModel.IExtenderProvider.CanExtend(object obj)
            {
                if (obj.GetType() == typeof(Component1)) return false;
                if (obj is IComponent) return true;
                return false;
            }
 
            public string GetTest(IComponent component)
            {
                if (!_commponentsIntlist.ContainsKey(component.ToString()))
                {
                    _commponentsIntlist.Add(component.ToString(), "");
                }
                return (string)_commponentsIntlist[component.ToString()];
            }
 
            public void SetTest(IComponent component, string value)
            {
                if (!_commponentsIntlist.ContainsKey(component.ToString()))
                {
                    _commponentsIntlist.Add(component.ToString(), value);
                }
                else
                    _commponentsIntlist[component.ToString()] = value;
            }
        }

Open in new window

0
Comment
Question by:ripahoratiu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
ripahoratiu earned 0 total points
ID: 21905407
OK I find my own answer. Basically the property exposed by the extender is there if you select in the property dropdown one of the column, but not in the columns collection editor. After digging a little bit the MS guys stated that the columns collection editor is not capable of doing that and probably will not be fixed soon.
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question