spidervenom
Programmer
Hi all,
I am using VB.NET and trying to remove. I have 2 forms (Form1 and Form2). When user clicks "Edit" button in Form1, Form2 will open.
Inside Form2, there is a list of Customer displays in a Datagrid control. When the user highlighted the current row, and click the "Remove" button on the form, the datagrid will remove the 1st Customer from the list (This works so far using RemoveAt()). The user then repeats the steps to highlight the row and click "Remove" to delete the 2nd and 3rd customer 1 by 1. When finish, the user click "Done" to return to Form1.
However, when clicking "Edit" again to go back into Form2, I notice that only the 1st Customer is remove from the Datagrid, but the 2nd and 3rd customer is still displaying in the Datagrid.
What I am expecting is when I return to Form2, all 3 Customers should not be displayed in the Datagrid. All I want is to remove the Customers from the DataTable, not sending any updates to affect the underlying Database.
In the "Done" button Click event, I tried to assign the updated DataTable (with the Customer deleted) to DataSource, and then perform a Datagrid Refresh(). I am still having the same problem.
Can anyone let me know how I can solve this problem?
Thanks a lot!!!
I am using VB.NET and trying to remove. I have 2 forms (Form1 and Form2). When user clicks "Edit" button in Form1, Form2 will open.
Inside Form2, there is a list of Customer displays in a Datagrid control. When the user highlighted the current row, and click the "Remove" button on the form, the datagrid will remove the 1st Customer from the list (This works so far using RemoveAt()). The user then repeats the steps to highlight the row and click "Remove" to delete the 2nd and 3rd customer 1 by 1. When finish, the user click "Done" to return to Form1.
However, when clicking "Edit" again to go back into Form2, I notice that only the 1st Customer is remove from the Datagrid, but the 2nd and 3rd customer is still displaying in the Datagrid.
What I am expecting is when I return to Form2, all 3 Customers should not be displayed in the Datagrid. All I want is to remove the Customers from the DataTable, not sending any updates to affect the underlying Database.
In the "Done" button Click event, I tried to assign the updated DataTable (with the Customer deleted) to DataSource, and then perform a Datagrid Refresh(). I am still having the same problem.
Can anyone let me know how I can solve this problem?
Thanks a lot!!!