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 get selected item of listbox

how to get selected item of listbox

Scheduled Pinned Locked Moved WPF
tutorial
4 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.
  • J Offline
    J Offline
    Jagz W
    wrote on last edited by
    #1

    i have listbox inside a datagrid. when user click save button i want to get the selected value of the list.

    One person's data is another person's program. --J.Walia

    A 1 Reply Last reply
    0
    • J Jagz W

      i have listbox inside a datagrid. when user click save button i want to get the selected value of the list.

      One person's data is another person's program. --J.Walia

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      You might to look at implementing a collection view model as given here[^].

      Me, I'm dishonest. And a dishonest man you can always trust to be dishonest.
      Honestly. It's the honest ones you want to watch out for...

      J 1 Reply Last reply
      0
      • A Abhinav S

        You might to look at implementing a collection view model as given here[^].

        Me, I'm dishonest. And a dishonest man you can always trust to be dishonest.
        Honestly. It's the honest ones you want to watch out for...

        J Offline
        J Offline
        Jagz W
        wrote on last edited by
        #3

        i want to get selected item of listbox.

        One person's data is another person's program. --J.Walia

        A 1 Reply Last reply
        0
        • J Jagz W

          i want to get selected item of listbox.

          One person's data is another person's program. --J.Walia

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          The collection view model keeps the underlying data source aware of the current list item selected and you can get the selected row by using methods like the CurrentItem (available inside ICollectionView).

          Me, I'm dishonest. And a dishonest man you can always trust to be dishonest.
          Honestly. It's the honest ones you want to watch out for...

          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