Solved

collection editors with user controls

Posted on 2004-04-22
6
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10896010
0
 
LVL 1

Author Comment

by:simion_tishler
ID: 10914896
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
ID: 10966874
Closed, 80 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 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