Solved

collection editors with user controls

Posted on 2004-04-22
6
320 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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