954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Unbound DataGridView + CSV

Hi Guys,

I am almost done with my program, until this problem arises and I can't solve.

I have two forms.

First form has 1 listbox and 2 buttons.
Second form has 1 datagridview and 1 button.

The first form opens the csv and list the location+filename of the CSV file. When the CSV files are listed in the listbox, the user can edit the selected csv file in listbox through edit button, when edit button is pressed, the second form will show as dialog and automatically opens the CSV files in DataGridView. The user will edit some fields and save and the second form will autoclose. Now here's the problem, when i select another CSV file in the listbox and press the edit button, the previous CSV still shows, even other CSV files I select, still the previous CSV file was showing.

What seems to be my problem? I tried disposing and refreshing the DGV but it will not work. Hope someone will help me. Thanks in advance.

renzlo
Junior Poster
107 posts since Oct 2011
Reputation Points: 14
Solved Threads: 4
 

Without seeing your code is difficult to say what is the origin of the problem.

Instead of disposing the DGV, try disposing the Second form and creating a new one before showing in dialog mode.

Hope this helps.

lolafuertes
Master Poster
798 posts since Oct 2008
Reputation Points: 120
Solved Threads: 167
 

thanks for the reply lolafuertes, since I'm not on my desk, i can't post it but I will as soon as possible. I'll try your suggestion.

renzlo
Junior Poster
107 posts since Oct 2011
Reputation Points: 14
Solved Threads: 4
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You