This project is read-only.

TableDataSource from a BindingSource Generated Table

Mar 28, 2011 at 6:54 PM

I cannot get the following code to create a plot that updates:

    Private WithEvents bs As BindingSource
    Dim filteredDataTable As DataTable
    Private Sub SetupPlot(ByRef plotter As ChartPlotter, ByRef lg As LineGraph, ByVal y As String, ByVal c As System.Windows.Media.Color)

        bs = Me.Resources("TestInfoFlowDataViewSource")
        filteredDataTable = CType(bs.List, DataView).ToTable
        Dim myData As TableDataSource = New TableDataSource(filteredDataTable)
        myData.SetXMapping(Function(Rows) Rows("FlowDataID"))
        myData.SetYMapping(Function(Rows) Rows(y))
        plotter.AddLineGraph(myData, c, 3, y)

    End Sub

If I replace 'filteredDataTable' with a DataTable straight from the DataSet (i.e. New TableDataSource(DataSet.FlowData)), then the plot updates properly.  Even when I added code to update 'filteredDataTable' with each added row, the plot did not update.  I can't figure out why that is.