Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. CollectionBase trouble...

CollectionBase trouble...

Scheduled Pinned Locked Moved ASP.NET
cssdesignhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kasic Slobodan
    wrote on last edited by
    #1

    I've downloaded some sample project and I found that contains code of how to implement adding items from design mode (CollectionBase). I've started to implement that into my test project I was working on and created a property like.

    public MenuItemCollection MenuItems
    {
    get { return items; }
    }

    When I go to design mode and add user control, in property grid, of that user control, I have MenuItems, but it doesn't open a dialog letting me to add the items. It acts like a string :confused:. To check whether I am crazy or not, I've added bool property to see will this work fine and display as a dropdown with true and false. That did worked, so now I am puzzled. I've searched on the net with no luck. I don't see any differences between that sample project and mine except that I use UserControl (partial class), but then again, why shouldn't properties work with partial classes as well (they worked with bool property) so now I am asking you for help. Thanks.

    N 1 Reply Last reply
    0
    • K Kasic Slobodan

      I've downloaded some sample project and I found that contains code of how to implement adding items from design mode (CollectionBase). I've started to implement that into my test project I was working on and created a property like.

      public MenuItemCollection MenuItems
      {
      get { return items; }
      }

      When I go to design mode and add user control, in property grid, of that user control, I have MenuItems, but it doesn't open a dialog letting me to add the items. It acts like a string :confused:. To check whether I am crazy or not, I've added bool property to see will this work fine and display as a dropdown with true and false. That did worked, so now I am puzzled. I've searched on the net with no luck. I don't see any differences between that sample project and mine except that I use UserControl (partial class), but then again, why shouldn't properties work with partial classes as well (they worked with bool property) so now I am asking you for help. Thanks.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Kasic Slobodan wrote:

      public MenuItemCollection MenuItems { get { return items; } }

      Looks like you are missing some attributes that has to be specified to add collection properties through property grid. I have an article which explains this. Have a look at here[^]

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      K 1 Reply Last reply
      0
      • N N a v a n e e t h

        Kasic Slobodan wrote:

        public MenuItemCollection MenuItems { get { return items; } }

        Looks like you are missing some attributes that has to be specified to add collection properties through property grid. I have an article which explains this. Have a look at here[^]

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

        K Offline
        K Offline
        Kasic Slobodan
        wrote on last edited by
        #3

        Your article helped. Thank you.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups