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.
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?
diluted_water
logogamer
I tried your code with no success. seems refresh() doesnot work. We are on .Net version 1.
AlexU
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