Here's my scenario: Work in a C# 2.0 environment with our view layer bound to a business logic layer of objects.
Here is what I'm attempting to do: Upon a form loading, user picks a value from a combobox and it brings back a collection of values. These values, I would like them to populate each row of a datagridview component. So let's say a user picks an item from the combobox that contains 3 values, so upon IndexChanged, the datagridview will display 3 rows. Oh, by the way, the datagridview will only have 2 columns - first column will be automatically populated by the collection above (3 values) and the right column, the user will be in charge of entering corresponding values. What I've done, is I'm able to loop through the collection brought back from above and then using the Rows.Add, I add each value to it, but I can't seem to know how to update the business object behind or when to set the datagridview's datasource. Not sure how to move forward - i.e. what events do I use, _AddingNew(), etc.?
Any advice will be greatly appreciated.
Here is what I'm attempting to do: Upon a form loading, user picks a value from a combobox and it brings back a collection of values. These values, I would like them to populate each row of a datagridview component. So let's say a user picks an item from the combobox that contains 3 values, so upon IndexChanged, the datagridview will display 3 rows. Oh, by the way, the datagridview will only have 2 columns - first column will be automatically populated by the collection above (3 values) and the right column, the user will be in charge of entering corresponding values. What I've done, is I'm able to loop through the collection brought back from above and then using the Rows.Add, I add each value to it, but I can't seem to know how to update the business object behind or when to set the datagridview's datasource. Not sure how to move forward - i.e. what events do I use, _AddingNew(), etc.?
Any advice will be greatly appreciated.