Hi, I'm using VB 2005, WinForms. I have DataGridView on one of my Forms. I use a BindingSource to supply data to the DataGridView as shown in the code below:
Public bs As New BindingSource '< Declared at the top of my Form.
In the LOAD event I state:
bs.DataSource = Me.dtTable1
DataGridView1.DataSource = bs
All that works fine...
I also have an RDLC report that I display using ReportViewer. I created a BindingSource for that report, because I wanted to filter the data in a different way than in the other BindingSource, so I declared it in my Button_Clicked event as shown below:
Dim bsReport As New BindingSource
bsReport.DataSource = Me.dtTable1
bsReport.Filter = "ProductID = 67"
Although this give me the correct results for my report, it re-filters my DataGridView1 to show only products with ProductID = 67. (Not what I wanted)
I know that both BindingSources are fed by the same DataTable (dtTable1), but why is one BindingSource affecting the other if I'm using "NEW" to declare the second BS? And equally as important, how can I avoid this and still be able to use the Filter option in BS to get the data I need in my report?