force the datagrid to refresh?

Hi,
I need to force datagrid to be populated with fresh data from DataSet. Seems datagrid.Refresh() doesnot work. any work around
Thanks.


Answer this question

force the datagrid to refresh?

  • diluted_water

    That code works fine for me with a bound listbox... I was hoping it would work with a datagrid.  I have no other ideas on how to refresh a datagrid.  Hopefully someone else can jump in and provide some insight.
  • logogamer

    Jacob,
    I tried your code with no success. seems refresh() doesnot work. We are on .Net version 1. 

  • AlexU

    I would try this:

    Dim cm As CurrencyManager

    If Not Me.DataGrid1.DataSource Is Nothing Then
         cm = CType(Me.DataGrid1.BindingContext.Item(DataGrid1.DataSource), CurrencyManager)
         If Not cm Is Nothing Then
              cm.Refresh()
         End If
    Else
         Me.DataGrid1.DataSource = AcquireDataSource
    End If

  • force the datagrid to refresh?