Developer
Developer

Reputation: 8636

How to delete the content from text file while deleting from datagridview

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

Upvotes: 0

Views: 2165

Answers (2)

Kamran Khan
Kamran Khan

Reputation: 9986

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

You will have to:

Upvotes: 0

ratty
ratty

Reputation: 13434

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.

Upvotes: 0

Related Questions