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. Delete selected rowes in a listview from .txt file

Delete selected rowes in a listview from .txt file

Scheduled Pinned Locked Moved C#
question
2 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.
  • A Offline
    A Offline
    andredani
    wrote on last edited by
    #1

    if i want to delete the selected row in a list view i use: if (listView1.SelectedItems.Count > 0) { if (MessageBox.Show("Vill du verkligen ta bort denna?", "Mina jobb", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--) listView1.Items.Remove(listView1.SelectedItems); } } But if i want to delete this selected row from a .txt file how do i do that..??? it´s four subitems and the .txt file look like this # blah blablah blabl blaaa //thanks;);P:^):(:sigh::doh:

    L 1 Reply Last reply
    0
    • A andredani

      if i want to delete the selected row in a list view i use: if (listView1.SelectedItems.Count > 0) { if (MessageBox.Show("Vill du verkligen ta bort denna?", "Mina jobb", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--) listView1.Items.Remove(listView1.SelectedItems); } } But if i want to delete this selected row from a .txt file how do i do that..??? it´s four subitems and the .txt file look like this # blah blablah blabl blaaa //thanks;);P:^):(:sigh::doh:

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      andredani wrote:

      But if i want to delete this selected row from a .txt file how do i do that..???

      It's your course assignment not ours. I'm pretty sure the point of the assignment is for "you" to figure that out rather than for you to go out on the internet and ask people how to do it. I mean really, you are in school now, if this is not the time when you are going to start thinking for yourself and developing problem solving skills, when are you?

      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