I still can't wrap my head around this. I've read several posts like:
New DataView vs. DefaultView of a DataTable
I have a DataTable that I bound to a DataGridView. I needed a fast filter capability so I created a DataView and bound that to the DataGridview (with some filters applied).
So now I'm looking at a filtered version of my original DataTable in the datagridview. With me?
Next, it adds a column with some data for each visible row. I used a 'For each row in DataGridView' to do this. When I remove my filters in the dataview (to show all rows). All the data I added in the columns disappears.
What is the proper way to interact with this data? If I add columns/data to the datagridview, do I have to apply that somehow to the dataview?
Please help clarify this concept.
Much appreciated.
Extra Info Here is my flow
- Fill DataTable
- Create DataView from DataTable
- Bind DataView to DataGridview
- User initiates filter on DataView based on critera
- User adds information to DataGridView (columns and data)
- User removes filter from DataView
- All original rows are now shown in the datagridview but the new column data is missing (columns are there but no data)