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. ListView...ItemCheck event..make some items hidden..but how?? again....

ListView...ItemCheck event..make some items hidden..but how?? again....

Scheduled Pinned Locked Moved C#
csharpdatabasehelpquestion
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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    hi! I ask this few days ago. but no one answert me.. therefore I ask over again.. ;) what I want to do.... when an user checked one item in the ListView the other items must come hidden. or: when an user checked one item in the ListView the other items must come hidden and after the user cheched the second time at this item all items was visible.... (I will make it to allowed the user to checked only 1 item) the even I will use is: private void displayCustomerListView_ItemCheck(object sender,System.Windows.Forms.ItemCheckEventArgs e) { for (int i = 0; i < displayCustomerListView.Items.Count; i++) { if(!(displayCustomerListView.Items[i].Index == e.Index)) { //and here must stand the code that make the Items[i] checkbox unvisible or unable to check } } } have anyone an idea how I can make this? (at best would help me a code sample in C#) big THX!! PAWEL

    L J 2 Replies Last reply
    0
    • L Lost User

      hi! I ask this few days ago. but no one answert me.. therefore I ask over again.. ;) what I want to do.... when an user checked one item in the ListView the other items must come hidden. or: when an user checked one item in the ListView the other items must come hidden and after the user cheched the second time at this item all items was visible.... (I will make it to allowed the user to checked only 1 item) the even I will use is: private void displayCustomerListView_ItemCheck(object sender,System.Windows.Forms.ItemCheckEventArgs e) { for (int i = 0; i < displayCustomerListView.Items.Count; i++) { if(!(displayCustomerListView.Items[i].Index == e.Index)) { //and here must stand the code that make the Items[i] checkbox unvisible or unable to check } } } have anyone an idea how I can make this? (at best would help me a code sample in C#) big THX!! PAWEL

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I want that the user make one choise from the list view. not multiple choice. Pawel

      D 1 Reply Last reply
      0
      • L Lost User

        I want that the user make one choise from the list view. not multiple choice. Pawel

        D Offline
        D Offline
        David Wengier
        wrote on last edited by
        #3

        To uncheck an item:

        displayCustomerListView.Items[i].Checked = false

        -- David Wengier Sonork ID: 100.14177 - Ch00k

        1 Reply Last reply
        0
        • L Lost User

          hi! I ask this few days ago. but no one answert me.. therefore I ask over again.. ;) what I want to do.... when an user checked one item in the ListView the other items must come hidden. or: when an user checked one item in the ListView the other items must come hidden and after the user cheched the second time at this item all items was visible.... (I will make it to allowed the user to checked only 1 item) the even I will use is: private void displayCustomerListView_ItemCheck(object sender,System.Windows.Forms.ItemCheckEventArgs e) { for (int i = 0; i < displayCustomerListView.Items.Count; i++) { if(!(displayCustomerListView.Items[i].Index == e.Index)) { //and here must stand the code that make the Items[i] checkbox unvisible or unable to check } } } have anyone an idea how I can make this? (at best would help me a code sample in C#) big THX!! PAWEL

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          If only one item can be selected why are you using the CheckListBox in the first place? Its very nature implies that you can select multiple items. If you only want to allow one item to be selected you should use a normal ListBox or create your own control that does what the CheckListBox does but uses Radio buttons instead of check boxes. James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

          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