Ohhh I understand your question now.
There are a few approaches to this that you can take.
I think I'd be more inclined to suggest that you look into creating a
Templated Control rather than using something like a GridView or a Repeater (but maybe that's just because I think they're cool).
Basically you're going to create a class that represents your "PartOrder" .
This class is going to have:
- A Public Part Number Property
- A Public Description Property
- A Public Cost Property
- A Public Quantity Property
- A Public Total Cost Function (or ReadOnly Property) that calculates the total cost based on the quantity and cost properties
- Some private validation methods if needed and maybe an IsValid Public function (or ReadOnly Property) so that you can check validation
- And maybe a public Update method that updates the database...if you want
You will have a collection of the "PartOrder" class which it will use as the Data Source.
You could either bind this collection to your Templated Control or you can bind this collection to a GridView or a Repeater control.
Which ever way you chose to do this you're going to need to use a "Template" to specify how your data is displayed to the user.
If you use a GridView then you'll use one or more
TemplateFields. In the TemplateField you can specify how your PartOrder is displayed to the user during "viewing" and during "editing". You can use different controls for each purpose.
I'm not sure what direction you're going to choose so let me know which you prefer before I start getting into more details about other options.
-Frinny