yababer
03-03-04, 02:44 PM
Hi,
I am trying to stream data into DataGrid Object (about 3000 cells per second, much like a stock ticker). I don't need to save the information, just display it until the driver changes and updates the grid with the new data. The whole application works except when I try to update the datagrid with the new datatable. Using the performance monitor, I can watch the %processor time slowly increase to 100% at which point the application begins to run sluggishly. However if I don't update the new datatables to the datagrid, the program runs fine and doesn't block. So I am thinking there must be a cache or something related to updating data to the datagrid that needs to be emptied.
I decided to use the dataview class on the new datatable because I have read it has less overhead than the dataset class, however I am open to suggestions on how to bind data to teh datagrid.
Can anyone help me find the best way to update data to a Datagrid continously without causing application slow down?
'Invoked Thread to take table from function and export to screen
Private Sub threadCompleteFirst(ByVal dataTable As DataTable)
'asigns the returned dataTable to the Global Object for next iteration
arg(1) = dataTable
If remove = False Then
'Updates the dataview to the new object
dv.Table() = arg(1)
'Sets the datasource to the grid only the first iteration
DataGrid1.DataSource() = dv
'bool
remove = True
Else
'Clears the table
dv.Table.Clear()
'Updates the dv table to new values
dv.Table = arg(1)
'Refrshs the DataGrid
DataGrid1.Refresh()
End If
'Slows the thread for cleaner update to screen
Thread.SpinWait(1)
'Starts next iteration
ThreadPool.UnsafeQueueUserWorkItem(AddressOf ns.Main, arg)
End Sub
Thanks for you help,
Yezdaaan
I am trying to stream data into DataGrid Object (about 3000 cells per second, much like a stock ticker). I don't need to save the information, just display it until the driver changes and updates the grid with the new data. The whole application works except when I try to update the datagrid with the new datatable. Using the performance monitor, I can watch the %processor time slowly increase to 100% at which point the application begins to run sluggishly. However if I don't update the new datatables to the datagrid, the program runs fine and doesn't block. So I am thinking there must be a cache or something related to updating data to the datagrid that needs to be emptied.
I decided to use the dataview class on the new datatable because I have read it has less overhead than the dataset class, however I am open to suggestions on how to bind data to teh datagrid.
Can anyone help me find the best way to update data to a Datagrid continously without causing application slow down?
'Invoked Thread to take table from function and export to screen
Private Sub threadCompleteFirst(ByVal dataTable As DataTable)
'asigns the returned dataTable to the Global Object for next iteration
arg(1) = dataTable
If remove = False Then
'Updates the dataview to the new object
dv.Table() = arg(1)
'Sets the datasource to the grid only the first iteration
DataGrid1.DataSource() = dv
'bool
remove = True
Else
'Clears the table
dv.Table.Clear()
'Updates the dv table to new values
dv.Table = arg(1)
'Refrshs the DataGrid
DataGrid1.Refresh()
End If
'Slows the thread for cleaner update to screen
Thread.SpinWait(1)
'Starts next iteration
ThreadPool.UnsafeQueueUserWorkItem(AddressOf ns.Main, arg)
End Sub
Thanks for you help,
Yezdaaan