473,322 Members | 1,620 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,322 software developers and data experts.

Code generation for properties in a UserControl

I'm writing a control which contains a collection of Column objects
which needs to be written to InitializeComponent() by the designer.
I've created a collection object (ColumnCollection) derived from
CollectionBase which contains Column objects. The Column object has
the TypeConverter attribute and the TypeConverter class implements
CanConvertTo() and ConvertTo() for type InstanceDescriptor. It does
work but there are a few problems that I have.

Firstly, I have a problem where the designer fails to write the
collection when I go to save it. This seems to occur randomly but
could be more frequent if I am actually working on the Column object
itself. It happens quite frequently for me and much less frequently
for the users of my control. The error given to me by the designer is
: "Code generation for property 'Columns' failed. Error was: 'Unable
to cast object of type 'EditColumn' to type 'EditColumn'.'" As you can
see it's trying to cast an object to the type that it already is.

Secondly, I have released this grid for people to use and I now want to
change the Column object to add more properties which need to be
written too. Is there some way to do this and allow the code that has
already been written to work.

Thanks for any help

steve.kaye

Oct 20 '06 #1
0 1160

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

Similar topics

0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
5
by: Wysiwyg | last post by:
I'm new to c# programming and can't figure out how to avoid duplicating common code in multiple classes when I'm restricted to using different system base classes.. I'm using c# in asp.net to write...
4
by: Mark Friedman | last post by:
I can't seem to figure out how to get a reference to a UserControl in the code-behind for the page that contains the control. All the examples I've seen show how to pass property values from the...
6
by: William Parker | last post by:
I have a web control I made called header.ascx. It has its own properties and methods I defined. But I cannot figure out how to access this control from my code behind page. I can create the...
3
by: Jim Hubbard | last post by:
If I create a usercontrol that is a tab with a webbrowser control on it, by default the new control exposes no properties of the tab or webbrowser control. What is the easiest way to bubble the...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
3
by: segecko | last post by:
Hi I have a created a custom usercontrol which inherites an Excel like usercontrol. In this usercontrol I have a custom property called SpreadTemplate, which is an enum with (at the moment) two...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
2
by: she_prog | last post by:
I have a class derived from UserControl. I need to serialize an object of this class, but only some properties of it, as not all properties are serializable (some of the properties coming from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.