B
BobRoyAce
Let's say that I have two classes: Franchise and FranchiseOwner.
Suppose that the Franchise class has a property, called
FranchiseOwners, which is a List(Of FranchiseOwner).
Now, suppose that I have a form, with a module-level object variable
of type Franchise, called m_oFranchise. Let's say that it has 3
Franchise Owners in it's FranchiseOwners property (i.e.
FranchiseOwners.Count = 3). The user selects one of the Franchise
Owners in a grid and then clicks on a button to EDIT them. This brings
up another form where the user can edit the Franchise Owner's
information and then click to save the changes. This edit form has a
readonly property that contains the edited FranchiseOwner.
If I was adding a new FranchiseOwner, I would simply add the
FranchiseOwner entered on the form to the FranchiseOwners list
(via .Add method) However, in this scenario, I am actually allowing
the user to update a FranchiseOwner already in the list.
My question relates to how I go about replacing the current
FranchiseOwner in the FranchiseOwners list with the one that was
entered on the edit form. How would I do that?
Suppose that the Franchise class has a property, called
FranchiseOwners, which is a List(Of FranchiseOwner).
Now, suppose that I have a form, with a module-level object variable
of type Franchise, called m_oFranchise. Let's say that it has 3
Franchise Owners in it's FranchiseOwners property (i.e.
FranchiseOwners.Count = 3). The user selects one of the Franchise
Owners in a grid and then clicks on a button to EDIT them. This brings
up another form where the user can edit the Franchise Owner's
information and then click to save the changes. This edit form has a
readonly property that contains the edited FranchiseOwner.
If I was adding a new FranchiseOwner, I would simply add the
FranchiseOwner entered on the form to the FranchiseOwners list
(via .Add method) However, in this scenario, I am actually allowing
the user to update a FranchiseOwner already in the list.
My question relates to how I go about replacing the current
FranchiseOwner in the FranchiseOwners list with the one that was
entered on the edit form. How would I do that?