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. General Programming
  3. C#
  4. Define Collection property problem

Define Collection property problem

Scheduled Pinned Locked Moved C#
helptutorial
5 Posts 3 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.
  • S Offline
    S Offline
    sepel
    wrote on last edited by
    #1

    Hi any one. i want to create some class library and allow user to add it some data in a Collection.(example of it is Items property in Combobox or listbox). i define a Dictionary collection and when using , it appear in control library but when i click it to add some data it show a disabled window.:confused: its my public property:

    public Dictionary<int32,> States
    {
    get
    {
    return MySexCell.States;
    }
    set
    {
    MySexCell.States = value;
    }
    }

    sepel

    modified on Tuesday, October 7, 2008 2:01 PM

    G M 2 Replies Last reply
    0
    • S sepel

      Hi any one. i want to create some class library and allow user to add it some data in a Collection.(example of it is Items property in Combobox or listbox). i define a Dictionary collection and when using , it appear in control library but when i click it to add some data it show a disabled window.:confused: its my public property:

      public Dictionary<int32,> States
      {
      get
      {
      return MySexCell.States;
      }
      set
      {
      MySexCell.States = value;
      }
      }

      sepel

      modified on Tuesday, October 7, 2008 2:01 PM

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      sepel wrote:

      public Dictionary<int32,> States

      Does that even compile? You need two datatypes in a Dictionary definition, one type for the key and one for the value. Perhaps you should use a List instead of a Dictionary?

      Despite everything, the person most likely to be fooling you next is yourself.

      S 1 Reply Last reply
      0
      • G Guffa

        sepel wrote:

        public Dictionary<int32,> States

        Does that even compile? You need two datatypes in a Dictionary definition, one type for the key and one for the value. Perhaps you should use a List instead of a Dictionary?

        Despite everything, the person most likely to be fooling you next is yourself.

        S Offline
        S Offline
        sepel
        wrote on last edited by
        #3

        I'm to being DIZZY .:confused: i write dictionary (int32,string)but it dosen't appear.(using "(" instade of "<") take it easy . i try to use List. But think about this forum syntax way does not appear my code. I test another type for my second Dictionary parameter but after post it no one appear.:confused:

        sepel

        modified on Tuesday, October 7, 2008 1:52 PM

        1 Reply Last reply
        0
        • S sepel

          Hi any one. i want to create some class library and allow user to add it some data in a Collection.(example of it is Items property in Combobox or listbox). i define a Dictionary collection and when using , it appear in control library but when i click it to add some data it show a disabled window.:confused: its my public property:

          public Dictionary<int32,> States
          {
          get
          {
          return MySexCell.States;
          }
          set
          {
          MySexCell.States = value;
          }
          }

          sepel

          modified on Tuesday, October 7, 2008 2:01 PM

          M Offline
          M Offline
          Mark Churchill
          wrote on last edited by
          #4

          MySexCell? *sniggers* Just what kind of application is this? You probably don't want to expose a "set" accessor. That is if you want people to change the entire dictionary. People can "get" the dictionary and then call .Add on it. You need to google the correct attributes to put on your property to enable designer support.

          Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
          Alpha release: Entanglar: Transparant multiplayer framework for .Net games.

          S 1 Reply Last reply
          0
          • M Mark Churchill

            MySexCell? *sniggers* Just what kind of application is this? You probably don't want to expose a "set" accessor. That is if you want people to change the entire dictionary. People can "get" the dictionary and then call .Add on it. You need to google the correct attributes to put on your property to enable designer support.

            Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
            Alpha release: Entanglar: Transparant multiplayer framework for .Net games.

            S Offline
            S Offline
            sepel
            wrote on last edited by
            #5

            Hahahah.(MySexCell) it is a cell that for male or female that saved in bit format in db, show corespond string such as "man or woman or Mr or Mrs,...". i think i should use Attribute . tnx

            sepel

            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