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

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 AvailableLogLevels in designer, it show 4 members (which is
correct) but each is called Messages.MessageBox+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 LogLevelCollection
Inherits System.Collections.CollectionBase
Public Sub Add(ByVal aLogLevel As LogLevel)
' Invokes Add method of the List object to add a new loglevel.
List.Add(aLogLevel)
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("Index refers to message out of range")
Else
' Invokes the RemoveAt method of the List object.
List.RemoveAt(index)
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

<EditorAttribute(GetType(System.ComponentModel.Des ign.CollectionEditor), _
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property AvailableLogLevels() As LogLevelCollection
Get
Return _AvailableLogLevels
End Get
Set(ByVal Value As LogLevelCollection)
_AvailableLogLevels = Value
End Set
End Property

Nov 21 '05 #1
0 866

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

Similar topics

2
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....
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...
2
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...
0
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...
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...
1
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...
0
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,...
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...
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...
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: 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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.