daviddoria
Member
- Joined
- Jan 11, 2007
- Messages
- 13
- Programming Experience
- Beginner
I have a table in a database with a few columns, one of which is AssociateName. It exists as a strongly typed dataset in my project. I populate a list box with the associate names. When I click on a name in the list box, I want to show all of the records for that person in the DataGridView. Then I want to be able to delete one of the rows in the DataGridView, and have the underlying data of that row also be deleted.
I have tried this:
Is this the right way to go about this? I am clearly doing something wrong because the row does not get removed from the DataGridView when I click delete.
Thanks,
Dave
I have tried this:
VB.NET:
'populate the DataGridView (by setting the datasource of the bindingsource that is attached to it)
PunchEventTableBindingSource.DataSource = TimetrackerDataSet.PunchEventTable.Select(FilterString, SortString)
'delete the row that is selected (in a "delete" button click event)
DirectCast(PunchEventTableBindingSource.Current, timetrackerDataSet.PunchEventTableRow).Delete()
Is this the right way to go about this? I am clearly doing something wrong because the row does not get removed from the DataGridView when I click delete.
Thanks,
Dave