473,698 Members | 2,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

collection editor in designer

sam
Hi

I'm having trouble with get the collection editor to show my collection in
designer. Have included what I think is the relevant code below. When I
click on the AvailableLogLev els in designer, it show 4 members (which is
correct) but each is called Messages.Messag eBox+LogLevel and has a value of
the same. What I had hoped for was 4 members each with a Name, TableColumn
and LogFileName (as per the LogLevel class). Any thoughts welcome....

Public Class LogLevel
Public Name As String
Public TableColumnName As String
Public LogFileName As String
End Class
Public Class LogLevelCollect ion
Inherits System.Collecti ons.CollectionB ase
Public Sub Add(ByVal aLogLevel As LogLevel)
' Invokes Add method of the List object to add a new loglevel.
List.Add(aLogLe vel)
End Sub
Public Sub Remove(ByVal index As Integer)
' Check the loglevel exists
If index > Count - 1 Or index < 0 Then
'check there is such an index to remove
Throw New Exception("Inde x refers to message out of range")
Else
' Invokes the RemoveAt method of the List object.
List.RemoveAt(i ndex)
End If
End Sub
Default Public ReadOnly Property Item(ByVal index As Integer) As
LogLevel
Get
' The appropriate item is retrieved from the List object and
' explicitly cast to the LogLevel type, then returned to the
' caller.
Return CType(List.Item (index), LogLevel)
End Get
End Property
End Class

<EditorAttribut e(GetType(Syste m.ComponentMode l.Design.Collec tionEditor), _
GetType(System. Drawing.Design. UITypeEditor))> _
Public Property AvailableLogLev els() As LogLevelCollect ion
Get
Return _AvailableLogLe vels
End Get
Set(ByVal Value As LogLevelCollect ion)
_AvailableLogLe vels = Value
End Set
End Property

Nov 21 '05 #1
0 883

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

Similar topics

2
2748
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx. The problem is the article is in VisualBasic. I already get the collection to be recognized as a Data Source by the IDE. It populated the DataGrid correctly from the fields on the items object of the collection, but I can't get the DataGrid to...
2
2513
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 pointer or reference to a derived type of the base class's return type. In .NET the overridden virtual function is similar, but an actual parameter of the function can be a derived reference from the base class's reference also. This dichotomy...
2
3173
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 problems that I have encountered to date and the solutions (if any) that I found. http://users.adelphia.net/~brianpclab/ServerControlCollectionIssues.htm This page also has all of the source code in a compressed file that you are free to download...
2
1953
by: James Doran | last post by:
Hello, I'd like to iterate through each Page of my ASP.NET project from within a Custom web control and access the Page.Controls collection. I've tried using Reflection on the web project assembly, but the controls collection count was zero. While this method gives details of the private controls in each page, I need access to actual instances of the controls to interrogate their individual properties.
0
1450
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and the 2nd property is a strongly typed collection class (myCollectionProperty). The collection contains a simple class (myCustomClass) which has 1 text property (TextProperty).
4
2519
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 Inherits System.Windows.Forms.UserControl Private _Collection As GridTableStylesCollection
1
1996
by: Martin Robins | last post by:
I have developed a custom control that, among others, includes a property that is a collection of "Items". If I place an instance of my control onto a CF form, I can view all of the properties correctly in the property grid and my collection appears with the ellipses ready to open the collection editor. Click on the ellipses and the editor opens correctly and I can add and remove items in the collection. Unfortunately, the incorrect code...
0
1277
by: cranley | last post by:
Hi. I'm currently building a custom control. On my custom control is a colleciton property which I wish to edit with the VS.NET collection editor. So far I have everything working as planned, however I want to update the designer UI of my custom control when a person modifies the collection property via the Collection Editor in the designer (similar to when you add/remove columns from a DataGridView). I've looked and looked, however,...
1
393
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 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...
0
8676
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
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8870
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...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6524
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
5860
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
4370
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...
1
3051
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
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.