0

I am having a datagridview where the content of that datagridview will be from my sample text file. When i click on load i will have the data from sample.txt and that data in that text file is shown in the datagridview. I will have a checkbox column in my datagridview. If the user checks i will select the row and when user clicks delete button i would like to delete that text from the text file.

Suppose my text is as follows alt text

If i click on the check box of first row and click on delete i would like to delete that text from text file

Randy Levy
  • 22,566
  • 4
  • 68
  • 94
Developer
  • 8,390
  • 41
  • 129
  • 238

2 Answers2

0

textfiles - How to delete a line from a text file in C#? - Stack ...

How to delete a line from a text file in C#?

See this link .

And some comments from me Here.

Read the all lines search the text u want and delete that text from list and write it in text file.

Community
  • 1
  • 1
ratty
  • 13,216
  • 29
  • 75
  • 108
0

How about using the Text OBDC or OLE DB to access the text file contents?

You will have to:

KMån
  • 9,896
  • 2
  • 31
  • 41