Solved

collection editors with user controls

Posted on 2004-04-22
6
317 Views
Last Modified: 2012-05-04
Hey I have created a collection that inherits from the CollectionsBase that take a columnheader as it's input. I have then created an intance of the collections class and provided a property to it through my usercontrol. The property uses the collections editor attribute to expose the collections editor at design time when I'm using my user control. When I click on the collections property through the desgner the editor pops up but it only displays a Systems.Object property and not all the properties of a column header. This is all pretty complex I know and if I have come this far I should be able to continue. I can but I just want to take the pain out of it if someone know the answer.

here is the code for the collection

public class ColumnCollection : System.Collections.CollectionBase
            {

                  public ColumnCollection()
                  {
                  
                  }
                  public void Add(ColumnHeader column)
                  {
                        List.Add(column);
                  }
                  public void Remove(int index)
                  {
                        // Check to see if there is a widget at the supplied index.
                        if (index > Count - 1 || index < 0)
                              // If no widget exists, a messagebox is shown and the operation
                              // is cancelled.
                        {
                              System.Windows.Forms.MessageBox.Show("Index not valid!");
                        }
                        else
                        {
                              List.RemoveAt(index);
                        }
                  }
                  public ColumnHeader Item(int Index)
                  {
                        // The appropriate item is retrieved from the List object and
                        // explicitly cast to the Widget type, then returned to the
                        // caller.
                        return (ColumnHeader) List[Index];
                  }


            }

here is the code for the property in the user control

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
            , EditorAttribute("typeof(CollectionEditor)","typeof(System.Drawing.Design.UITypeEditor)")]
            public ColumnCollection ColumnsCollection
            {
                  get
                  {
                        return columnscollection;
                  }
                  set
                  {
                        columnscollection = value;
                  }
            }

Thanks in advance and sorry about the low points. It's all a have left.

Simion

0
Comment
Question by:simion_tishler
  • 2
6 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
Comment Utility
0
 
LVL 23

Expert Comment

by:rama_krishna580
Comment Utility
0
 
LVL 1

Author Comment

by:simion_tishler
Comment Utility
hey rama

that didn't help. Have you actually used the collection editor before? The article was concerning runtime environments.
0
 

Accepted Solution

by:
modulo earned 0 total points
Comment Utility
Closed, 80 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now