473,670 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control - ListDictionary property

I'm trying to create a user control that would have a ListDictionary
property. When trying to use the property and set values for this
collection, the dialog box that appears has everything disabled. I'm
unsure of what I have to have set in code in order to enable this??

Jul 21 '05 #1
4 3693
"Doug" <dn******@dtgne t.com> wrote in news:1115038097 .606701.212890
@o13g2000cwo.go oglegroups.com:
I'm trying to create a user control that would have a ListDictionary
property. When trying to use the property and set values for this
collection, the dialog box that appears has everything disabled. I'm
unsure of what I have to have set in code in order to enable this??


There is no designer for this class. You would need to write a designer.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Jul 21 '05 #2
I'm not sure I understand your answer. Basically, I need a way to have
my user control contain a collection property (it doesn't have to be a
list dictionary one). So if I have a property like this:

private ListDictionary m_oValues = new ListDictionary( );
[MergablePropert y(false)]
[RefreshProperti es(RefreshPrope rties.All)]
public ListCollection Values
{
get
{
return m_oValues;
}
set
{
m_oValues = value;
}
}

In the properties box this property will show up with an ellipsis.
When I click the ellipsis the Object Collection Editor box will display
but everything is disabled.

I've been doing some reading and it seems that you need a seperate
class that inherits from CollectionBase to do this. So I wrote one
just for a test:

public class Test : CollectionBase
{
public void Add(string o)
{
List.Add(o);
}
public void Remove(string o)
{
List.Remove(o);
}
public string this[int index]
{
get
{
return (string)List[index];
}
set
{
List[index] = value;
}
}
}

and then switch the code that read like this:

private ListDictionary m_oValues = new ListDictionary( );

to this:

private Test m_oValues = new Test();
That seemed to work, and the ADD button was now enabled in the Object
Collection Editor, however when I tried to use the ADD button, I got
the error "Constructo r on System.String not found". So apparently, my
collection cannot be of a string type.

I'm really unsure of what I'm doing here or if I'm going way down the
wrong path. What I need is the ability to have a control with a
collection property that develpers can add and remove info from.

Jul 21 '05 #3
One other thing. I figured out how to do this if I went with a
StringCollectio n instead of a ListDictionary. However that won't work
for me as it brings the string collection editor and only allows one
entry (per line), it doesn't have an option for description and value.
I'm hoping to have a collection that does something like this:

Description = Yes Value = Y
Description = No Value = N
Description = Unknown Value = U

Jul 21 '05 #4
"Doug" <dn******@dtgne t.com> wrote in news:1115043776 .235345.221630
@l41g2000cwc.go oglegroups.com:
I'm not sure I understand your answer. Basically, I need a way to have
Properties, especially classes just dont "magically" have editors in Visual
Studio. Someone has to write them. Microsoft made editors for many of the
common classes, but other classes that it didnt make sense to make a generic
editor for, or just didnt make sense they didnt.

So you have to write a property editor for your class/property, or
ListDictionary if you want it to be that generic.
In the properties box this property will show up with an ellipsis.
When I click the ellipsis the Object Collection Editor box will display
but everything is disabled.


Because its probably invoking some default editor with basic actions.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
Jul 21 '05 #5

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

Similar topics

0
925
by: Jim Douglas | last post by:
{System.Collections.Specialized.ListDictionary.NodeKeyValueCollection} : {System.Collections.Specialized.ListDictionary.NodeKeyValueCollection} Count: 25 ?entry.Contains("MachineName") true
6
2785
by: Allen Jones | last post by:
Hi, I tried to extend ListDictionary in order to create a thread safe version named SynchronizedListDictionary. Despite the docs saying the properties and methods of ListDictionary are virtual, when I try to compile my derived class, the compiler tells me that I "cannot override inherited member XXX because it is not marked virtual, abstract, or override".
2
1823
by: Doug | last post by:
Not that I'd actually do this... but knowing the answer would give me a bit more understanding of the .NET Framework and the base class libraries - specifically how things work in relation to my own custom classes or libraries. We could use any of the framework's classes - but lets take, for example, the ListDictionary (System.Collections.Specialized.ListDictionary). When solving some programming problem, I could (1) use the...
0
1213
by: Gabriel Cirera | last post by:
Hello, Is it possible to fill a DataGrid with a ListDictionary? I tried to find the solution in this groups but I couldn't... Maybe is not possible.. who knows. I suppose it has to be some way to convert the ListDictionary to a kind of System.Data.DataSet. Thanks in advance! Gabriel
6
11276
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
1649
by: SK | last post by:
Hello, I am trying to convert an object to a ListDictionary, but I get always the error: Specified cast is not valid. Here is my code: Private Property StoredProcedureParams() As ListDictionary Get Dim o As Object = ViewState("StoredProcedure") If o Is Nothing Then
4
2509
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once I have exposed a public property containing the value of a textbox in a user control..how do I grab this from the calling page? I cant think of the syntax, since my page doesnt know the contents of the class (and therefore, the public...
1
1912
by: John Keenan | last post by:
I have a user control with 2 buttons on it & 1 label.... as each button is pressed, they set a member variable within the class and sets the label test. I also have a get/set property for the member variable. At Page_Load time I initialize this member variable I have a host form which contains the user control I have a button and a label on the host form (in addition to the user control) Now when I click the host-form button, it is...
4
348
by: Doug | last post by:
I'm trying to create a user control that would have a ListDictionary property. When trying to use the property and set values for this collection, the dialog box that appears has everything disabled. I'm unsure of what I have to have set in code in order to enable this??
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8901
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8813
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.