Ignore this - I misread your question
What I would do, is attach a Binding/DataSource to the DataGridView, then set the filter to (whatever) .. for example,
bs.Filter = string.Format("Date Between #{0:yyyy/MM/dd}# And #{1:yyyy/MM/dd}#", startDate, endDate);
Ok, you don't say how your datagridview is populated .. I generally find that using a BindingSource gives a lot of flexibility (which is why I went off tangent in my first thought) .. so, I would suggest looking at using a datatable and bindingsource for your
chart .. this gives a a bit of flexibility, including
1) I think you could fill the chart datatable using linq from the datagridview datatable, ie a query between your two data ranges
2) you could manually fill the chart datatable either from your datagridview directly or from the datagridview datatable
3) you could conceivably use the same bindingsource filter on both datagridview and chart
I haven't done it for eons, but I think a change to the datatable or bindingsource forces a refresh, which is how your chart would 'redisplay' when you change data/filter - or Im pretty sure it's easy enough to 'tell the chart to refresh' - that covers this 'wish'
Quote:
So, in the end, I want the chart to display the data in either weekly (7 days) or (if another tab is select) monthly (31 days) with the data in the datagridview being sorted.
[Edit] Worth having a look at, can the chart binding source select the columns from the datagridview datatable ? if so, then your job is even easier - this might help
Binding Data to Series (Chart Controls) | Microsoft Docs[
^] [/Edit]