Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

collection editors with user controls

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
simion_tishler
Asked:
simion_tishler
  • 2
1 Solution
 
rama_krishna580Commented:
0
 
simion_tishlerAuthor Commented:
hey rama

that didn't help. Have you actually used the collection editor before? The article was concerning runtime environments.
0
 
moduloCommented:
Closed, 80 points refunded.

modulo
Community Support Moderator
Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now