|
-
Sep 29th, 2003, 09:44 PM
#1
Thread Starter
Lively Member
Problem refreshing e datagrid
Hi, everybody. I got a small problem with the datagrid, when user click on one of e record from the datgrid, it will show e record displaying in e textbox. When i edit or delete on e record, then i close e form. How come my datagrid wont refresh, n display the amended record?
Can u pls help mi? I got refresh e datagrid but it wont helps at all.
-
Sep 30th, 2003, 06:49 AM
#2
Sleep mode
Refresh method won't work but as a workaround , you need to re-iterate the Grid . So , better you call the procedure that you use to fill the Grid again .
-
Sep 30th, 2003, 11:20 AM
#3
Lively Member
Are you saving the changes to the datatable/datarow/dataset? If not, you wont ever see changes in the data that is populating your controls. After you make changes to a textbox contents you need to update the datatable with the changes and then save the changed rows to the database via a dataAdapter. If you just change it in the datatable and dont post it to the database, the change will only be reflected in memory and will be lost when the form is destroyed or the datatable goes out of scope.
Please give me some more details of what you are trying to accomplish and I can get you some code to do it.
If you have a datagrid bound to a datatable, any changes to the datatable will be reflected in the datagrid automatically. if you arent seeing them, you arent updating your datatable with the changes.
-
Sep 30th, 2003, 03:26 PM
#4
Frenzied Member
Originally posted by Pirate
Refresh method won't work but as a workaround , you need to re-iterate the Grid . So , better you call the procedure that you use to fill the Grid again .
Refresh method of datagrid works, but it is not intended to refresh the datasource, it just invalidates and repaints the control. To refresh the data you may refresh the datasourse or the currency manager.
'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
-
Sep 30th, 2003, 03:30 PM
#5
Lively Member
refresh is useless unless the changes are persisted to the database at some time. No sense in refreshing from the database if the updates were never sent there. This guy needs to let us know what he has so far.
-
Sep 30th, 2003, 03:31 PM
#6
Frenzied Member
we were talking about datasource of the datagrid not the database.
'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
-
Sep 30th, 2003, 03:31 PM
#7
Sleep mode
Originally posted by Lunatic3
Refresh method of datagrid works, but it is not intended to refresh the datasource, it just invalidates and repaints the control. To refresh the data you may refresh the datasourse or the currency manager.
Which is what I'm saying ....
-
Sep 30th, 2003, 03:33 PM
#8
Frenzied Member
Originally posted by Pirate
Which is what I'm saying ....
But you said it doesn't work, so he may think that the mission of refresh method in the datagrid is to refresh the data but due to some problems it does not work, which is not the case.
'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
-
Sep 30th, 2003, 03:40 PM
#9
Sleep mode
Originally posted by Lunatic3
But you said it doesn't work, so he may think that the mission of refresh method in the datagrid is to refresh the data but due to some problems it does not work, which is not the case.
Yes , I did say that because he mentioned that it didn't work (refresh method) . So I put a solution in his hand that works usually .
-
Sep 30th, 2003, 08:59 PM
#10
Thread Starter
Lively Member
I am saving under dataset. How do i refresh the changes for the dataset? Can u show mi some codes...
-
Oct 1st, 2003, 06:22 AM
#11
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
|