Refresh a DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H
I need to create an application that sit on a computer to display data as its added into a table in a SQL Server database. The data is going to be populated by an IVR system.
As data is added by the IVR system, my application has to show these records
For this I want to use a datagrid, but I cannot seem to find out how to refersh the data after I bind the datagrid to a dataset
Datagrid.refersh does nothing. I read some where to use the currency manager to refersh data in a datagrid , I used the following cod
Dim Cs as Currencymanager=Ctype(DataGrid1.BindingContext(Datasource),CurrencyManager
Cs.refers
This also did not work

The only thing that worked was
Dataset1.clea
SqldataAdapter1.fill(Dataset1
This has a problem in that the grid keeps re drawing itsel

Any body has any ideas on what the best way is and also how to refersh data in a datagrid
 
Geogie said:
Hi
I need to create an application that sit on a computer to display data as
its added into a table in a SQL Server database. The data is going to be
populated by an IVR system.
As data is added by the IVR system, my application has to show these records.
For this I want to use a datagrid, but I cannot seem to find out how to
refersh the data after I bind the datagrid to a dataset,
Datagrid.refersh does nothing. I read some where to use the currency
manager to refersh data in a datagrid , I used the following code
Dim Cs as Currencymanager=Ctype(DataGrid1.BindingContext(Datasource),CurrencyManager)
Cs.refersh
This also did not work.

The only thing that worked was
Dataset1.clear
SqldataAdapter1.fill(Dataset1)
This has a problem in that the grid keeps re drawing itself

This is the right way to do it. However, you want to do it at an interval
(not as many times as you can, so put it on a timer.) second... use
SuspendBinding and ResumeBinding to deal with the nasty flickering from a
refresh. (Suspend and Resume are in your CurrencyManager class)

So.. essentially you have

cm.SuspendBinding()
sqldatadapter1.fill(dataset)
cm.resumebinding()


-CJ
Any body has any ideas on what the best way is and also how to refersh
data in a datagrid
 
Back
Top