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

Heeelp please, using enumerator in Property but its not getting saved...

Hi,
I'm using an enumerator to store some options so that at design time X
options could be selected. All this works fine until the developer closes
the FORM where the property is and re-opens it.l.. the values are reset.
Why??? This is what I have:

public class LidColumnCollection : CollectionBase
{
public LidColumnCollection()
{
}
public int Add(LidColumnItem Item)
{
return List.Add(Item);
}
public LidColumnItem this[int Index]
{
get
{
return List[Index] as LidColumnItem;
}
set
{
List[Index] = value;
}
}
}
public class LidColumnItem : Component
{
private string nombreColumnaBaseDatos;
private string nombreADeplegar;
private LidEnumTipoCampo tipoCampo;
public enum LidEnumTipoCampo {String,Date,Numeric};
//Constructor
public LidColumnItem()
{
}
[Description("Column Name")]
public string NombreColumnaBaseDatos
{
get {return nombreColumnaBaseDatos;}
set {nombreColumnaBaseDatos = value;}
}
[Description("Display Name")]
public string NombreADeplegar
{
get {return nombreADeplegar;}
set {nombreADeplegar = value;}
}

[
Description("Type of Data.")
]
public LidEnumTipoCampo TipoCampo
{
get
{
return this.tipoCampo;
}
set
{
this.tipoCampo = value;
}
}
}

NOTE: this is the Property on a Form that is inherited afterwards using
visual inhertiance. This is the property that is manipulated in design time

private LidColumnCollection lidColumnasAMostrar = null;
[

DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content),
Editor(typeof(System.ComponentModel.Design.Collect ionEditor),
typeof(System.Drawing.Design.UITypeEditor)),
Description("A Collection od strings a data type that will be placed on
the GridList"),
ToolboxItem(false)
]
public LidColumnCollection LidColumnasAMostrar
{
set
{
lidColumnasAMostrar = value;
}
get
{
if(lidColumnasAMostrar == null)
{
lidColumnasAMostrar = new LidColumnCollection();
}
return lidColumnasAMostrar;
}
}
Help is really appreciated
Lucas
Nov 15 '05 #1
2 1102
Hi Lucas,

I believe Form closed = Form bye, bye.

Which means that you'll have to persist the values between
invocations.

Regards,
Fergus
Nov 15 '05 #2
Fergus

I thught I was peristing the code using the attribute:
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)

Unless I'm missing something...

Regards
Lucas

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
Hi Lucas,

I believe Form closed = Form bye, bye.

Which means that you'll have to persist the values between
invocations.

Regards,
Fergus

Nov 15 '05 #3

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

Similar topics

6
by: John J. Lee | last post by:
I'm tearing my hair out at what seems like weird import behaviour I'm getting from Python's stdlib test script, regrtest.py (not for the first time: seem to have forgotten the resolution from last...
0
by: CGuy | last post by:
URGENT HELP REQUIRED FROM GURUS Hi, I have a custom object that implements ICollection and IListSource. This object has also an enumerator defined for it which implements IEnumerator and...
0
by: Stephen | last post by:
I have been getting on well with help from this forum trying to create an array list and work with it. Everything is working fine apart from displaying my array list items into the labels in my...
1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
2
by: Stephanie Stowe | last post by:
Hi. I am trying to understand the weird System.DirectoryServices object model. I have a DirectoryEntry object. I want to enumerate through the PropertyCollection. So I looked at GetEnumerator....
0
by: jahyen | last post by:
I'm having trouble getting my custom control to save properties that are decorated with the PersistenceMode.InnerProperty attribute. The properties that are saved with PersistenceMode.Attribute...
1
by: LedZep | last post by:
This program has to use a stack to determine whether a string is a palindrome (a string that is spelled identically backward and forward). The program has to ignore spaces, case sensitivity and...
2
by: John Dalberg | last post by:
In a traditional for loop, one can use the index (say i) and continue looping in another function and come back to original for loop (even though it's not good practice) Can the newer foreach...
1
by: virajitha | last post by:
Hi .... I am facing a major problem in writing a javascript that will load an xml document dynamically and posts it to the next page when clicked on a hyperlink. The problem is that in the...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.