Solved

collection editors with user controls

Posted on 2004-04-22
6
318 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
ID: 10895877
0
 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

23 Experts available now in Live!

Get 1:1 Help Now