473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Collection Editor woes...

I have a control that is subclassing a label control and I want to a a
property that is a List of a custom class. The collection editor
_seems_ to work fine. I can add new items to the list and it saves
them. I can even run the application and everything works...then at
some point later (between other changes, rebuilds), the designer
errors on the form/user control where that control is placed.

Warning 2 Object of type
'System.Collections.Generic.List`1[Lbm.Falcon.UI.MenuEvent]' cannot be
converted to type
'System.Collections.Generic.List`1[Lbm.Falcon.UI.MenuEvent]'. C:
\Projects\Falcon\Applications\CashReceipts.designe r.cs 1603 0

What is more bizzare is it appears it can't convert the type into the
same type as itself! No amount of rebuilds will fix this. I have to
remove this line from the designer code by hand:

this.menuLinkLabel2.MenuEvents =
((System.Collections.Generic.List<Lbm.Falcon.UI.Me nuEvent>)
(resources.GetObject("menuLinkLabel2.MenuEvents")) );

Code for the class is below... I just don't see the problem :-(

public class MenuLinkLabel : UltraLabel
{
public MenuLinkLabel()
: base()
{
_menuEvents = new
List<MenuEvent>();
}

private List<MenuEvent_menuEvents;

public List<MenuEventMenuEvents
{
get { return _menuEvents; }
set { _menuEvents = value; }
}

}

[Serializable]
public class MenuEvent
{
private string _menuText;

public string MenuText
{
get { return _menuText; }
set { _menuText = value; }
}

private string _application;

public string Application
{
get { return _application; }
set { _application = value; }
}

private bool _defaultChoice;

public bool DefaultChoice
{
get { return _defaultChoice; }
set { _defaultChoice = value; }
}

private string _eventKey;

public string EventKey
{
get { return _eventKey; }
set { _eventKey = value; }
}
}

Aug 22 '07 #1
0 1375

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: m. pollack. | last post by:
Hi all, Is there any information to be had about the "Object Collection Editor" that appears when you click on a collection property in the PropertyGrid control? I have a class that maintains a...
0
by: Sundown | last post by:
I am trying to create a custom button control for the web that, when clicked, disables and changes the text of itself and a bunch of other controls (in the collection). My goal is to end up with a...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
3
by: Shimon Sim | last post by:
I have control. One of the properties is implemented as StringCollection. I didn't use any Editor attribute for it. During Design time system shows dialog similar to Items in DropDownList but Add...
2
by: S. Justin Gengo | last post by:
Hi, I've created a component that allows me to store database information for various types of databases my company uses. It uses a collection for each type of database. Everything is working...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
1
by: timnels | last post by:
I have a control that is subclassing a label control and I want to a a property that is a List of a custom class. The collection editor _seems_ to work fine. I can add new items to the list and it...
4
by: Rohan | last post by:
I need to use the Collection editor of the propertyGrid, but i can't this to work, i looked around on the NET on collection and I am kinda lost. i have this so far, i don't know what i should do...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.