|
-
Jun 30th, 2003, 12:47 AM
#1
Thread Starter
New Member
refresh datagrid
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
-
Jun 30th, 2003, 05:34 AM
#2
Frenzied Member
I am not at my dev machine now to check it, but maybe you have to refresh the underlying currency manager of your datagrid.
Last edited by Lunatic3; Jun 30th, 2003 at 05:44 AM.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Jul 2nd, 2003, 09:02 PM
#3
Junior Member
refresh 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
-
Jul 2nd, 2003, 09:14 PM
#4
Frenzied Member
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
-
Jul 3rd, 2003, 02:50 AM
#5
Junior Member
refresh datagrid ( resolved)
just put this into your code
ds.clear()
regards
-
Jul 3rd, 2003, 02:58 AM
#6
Frenzied Member
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.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Jul 3rd, 2003, 10:16 AM
#7
Frenzied Member
I think this should work for you.
VB Code:
Dim cm As CurrencyManager
cm = CType(Me.BindingContext("datagrid data source here"), CurrencyManager)
cm.Refresh
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|