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. ListCollectionView customsort

ListCollectionView customsort

Scheduled Pinned Locked Moved WPF
helpcsharpwpfalgorithmsquestion
4 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
    Sakhalean
    wrote on last edited by
    #1

    Hi All, I have a wpf usercontrol listview with checkboxes. When I sort items on this listview by clicking any of the column of the listview, the checkboxes will be unselected. I am using ListCollectionView's cutomsort property.If I have selected more than two items then after sorting only one item will be selected and remaining checkboxes will be unselected. I am fully confusion who is making them to unselect the checkboxes after sorting. Can any one can help me for solving this issue?

    S K 2 Replies Last reply
    0
    • S Sakhalean

      Hi All, I have a wpf usercontrol listview with checkboxes. When I sort items on this listview by clicking any of the column of the listview, the checkboxes will be unselected. I am using ListCollectionView's cutomsort property.If I have selected more than two items then after sorting only one item will be selected and remaining checkboxes will be unselected. I am fully confusion who is making them to unselect the checkboxes after sorting. Can any one can help me for solving this issue?

      S Offline
      S Offline
      SledgeHammer01
      wrote on last edited by
      #2

      Remember, in the WPF ListView, containers are destroyed & re-created by default. If your checkboxes (or any other control) are not data-bound, they will lose state. You'll even see the checkboxes get unchecked if you scroll the item out of view far enough.

      1 Reply Last reply
      0
      • S Sakhalean

        Hi All, I have a wpf usercontrol listview with checkboxes. When I sort items on this listview by clicking any of the column of the listview, the checkboxes will be unselected. I am using ListCollectionView's cutomsort property.If I have selected more than two items then after sorting only one item will be selected and remaining checkboxes will be unselected. I am fully confusion who is making them to unselect the checkboxes after sorting. Can any one can help me for solving this issue?

        K Offline
        K Offline
        Kenneth Haugland
        wrote on last edited by
        #3

        Cold we see the code that does the sorting, and I assume that the checkboxes are binded no?

        S 1 Reply Last reply
        0
        • K Kenneth Haugland

          Cold we see the code that does the sorting, and I assume that the checkboxes are binded no?

          S Offline
          S Offline
          Sakhalean
          wrote on last edited by
          #4

          Hi yes checkboxes are binded.

          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