Retrieve a cells value before it was changed
-
Hi, I have a table "Inventory" that has ID, ItemNumber, Description etc fields and the user can edit these via a datagrid. The ItemNumber is also used in another table "SalesHistory". What I want to do is update the ItemNumber in "SalesHistory" once the user has elected to do so before saving the ItemNumber change in the "Inventory" table to the database. The problem I am having is determining the "old" value so I can update the "SalesHistory" table. I don't want to call the database again to find the old value by matching ID's but it seems I have no alternative. Suggestions please ...
Glen Harvy
-
Hi, I have a table "Inventory" that has ID, ItemNumber, Description etc fields and the user can edit these via a datagrid. The ItemNumber is also used in another table "SalesHistory". What I want to do is update the ItemNumber in "SalesHistory" once the user has elected to do so before saving the ItemNumber change in the "Inventory" table to the database. The problem I am having is determining the "old" value so I can update the "SalesHistory" table. I don't want to call the database again to find the old value by matching ID's but it seems I have no alternative. Suggestions please ...
Glen Harvy
Two ideas, check if there is an event for just before an something is changed (i know text boxes have it :rolleyes:) and do everything there (you can see what the new value is from the eventargs). Or make a custom control that inherits a datagrid, and if you can, override the part where items are updated. Sorry if i'm a little vague, but im off to bed, up early tomorrow :(( :zzz:
-
Two ideas, check if there is an event for just before an something is changed (i know text boxes have it :rolleyes:) and do everything there (you can see what the new value is from the eventargs). Or make a custom control that inherits a datagrid, and if you can, override the part where items are updated. Sorry if i'm a little vague, but im off to bed, up early tomorrow :(( :zzz:
There's no obvious event that I can find (eg cellEnter) so I can store the value before it's changed. Goodnight and thanks for your suggestions :cool:
Glen Harvy