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. WPF
  4. How to add option (none) and (new) to itembinding combobox

How to add option (none) and (new) to itembinding combobox

Scheduled Pinned Locked Moved WPF
helptutorialquestion
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.
  • L Offline
    L Offline
    Loveisasea
    wrote on last edited by
    #1

    Usually we use ItemSource property to set comboboxitems automatically. However, we also often hope to attach the following two options to the dropdownitems of combobox. (None): Sometimes we need to reset the value to none. but the itembinding combobox doesn't offer. You have to select one value. (Add); We also want to add a new value when the itembinding data doesn't include what we want. And we don't want to go to another page to initial this request. I think it is a common function about combobox. but the bad thing is I can not find a good template for this. Would anyone know about it? Thanks in advance for your help.

    P M 2 Replies Last reply
    0
    • L Loveisasea

      Usually we use ItemSource property to set comboboxitems automatically. However, we also often hope to attach the following two options to the dropdownitems of combobox. (None): Sometimes we need to reset the value to none. but the itembinding combobox doesn't offer. You have to select one value. (Add); We also want to add a new value when the itembinding data doesn't include what we want. And we don't want to go to another page to initial this request. I think it is a common function about combobox. but the bad thing is I can not find a good template for this. Would anyone know about it? Thanks in advance for your help.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Well, you could always do a variation of the technique I describe in my blog entry here[^].

      Forgive your enemies - it messes with their heads

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      L 1 Reply Last reply
      0
      • P Pete OHanlon

        Well, you could always do a variation of the technique I describe in my blog entry here[^].

        Forgive your enemies - it messes with their heads

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        L Offline
        L Offline
        Loveisasea
        wrote on last edited by
        #3

        The article is great :thumbsup:. But the CompositeCollection is not included in silverlight in which my platorm is.

        P 1 Reply Last reply
        0
        • L Loveisasea

          Usually we use ItemSource property to set comboboxitems automatically. However, we also often hope to attach the following two options to the dropdownitems of combobox. (None): Sometimes we need to reset the value to none. but the itembinding combobox doesn't offer. You have to select one value. (Add); We also want to add a new value when the itembinding data doesn't include what we want. And we don't want to go to another page to initial this request. I think it is a common function about combobox. but the bad thing is I can not find a good template for this. Would anyone know about it? Thanks in advance for your help.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          I usually take a copy of the list servicing the combo and insert a couple of dummy records into the start of the list. Then you need to detect the content in the SelectedObject and deal with it when it is "Add"

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • L Loveisasea

            The article is great :thumbsup:. But the CompositeCollection is not included in silverlight in which my platorm is.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Thanks for that, but if I were you I would include vital information such as platform in future just so you don't get answers like mine.

            Forgive your enemies - it messes with their heads

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            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