Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading the Web.Config using IIS 7.5? 4 36
Printing 1 51
Modal Popup Extender control 1 20
DataTables + iCheck + pagination Issue 2 22
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

773 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