Solved

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

Posted on 2008-06-26
1
416 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
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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