Dear All,
how to refresh the datagrid after i made some changes of by data. i used
datagrid1.Refresh()
but it is not working, please help.
regards
Printable View
Dear All,
how to refresh the datagrid after i made some changes of by data. i used
datagrid1.Refresh()
but it is not working, please help.
regards
I am not at my dev machine now to check it, but maybe you have to refresh the underlying currency manager of your datagrid.
solly i didnt get what u mean,,,'refresh the underlying currency manager of your datagrid.' ,,appreciate if u can give me some sample code !
TIA
Boon
I dont think refreshing the datagrid will work. You have to refresh the underlying datasource. So you would do something like this
VB Code:
Dim ds as New DataSet() dataGrid1.DataSource = ds.Tables("mytable").DefaultView 'make changes here Dim tempDs as DataSet = ds.GetChanges() ds.Merge(tempDs) 'datagrid should be refreshed with new data
just put this into your code
ds.clear()
regards
I will post you the code for refreshing the currency manager when i get home. You dont need to use temporary datasets. You better take a look at databinding concept in windows forms first.
I think this should work for you.
VB Code:
Dim cm As CurrencyManager cm = CType(Me.BindingContext("datagrid data source here"), CurrencyManager) cm.Refresh