Tim-TPM
Posts: 3
|
Posted: 03/02/2010, 4:30 AM |
|
Hi,
I want to implement something similar to the the example "Many-to-Many Relations via CheckBox List", but the problem is that there was one Text field for the CheckBoxes (project name, in that example) and I want to display more information for each CheckBox option.
Can I combine a grid with the CheckBox List control, having CheckBoxes in each grid row that will insert/update a many-to-many relationship?
I would very much appreciate your help on how to do it.
(I'm using C#.NET)
Thanks in Advance
Tim
|
|
|
Tim-TPM
Posts: 3
|
Posted: 03/03/2010, 11:55 PM |
|
I tried simply placing a CheckBox List in a grid, it obviously didn't work and I got the warning message " For the Checkbox List only the first value is inserted or updated."
Any suggestions?
Regards
|
|
|
dragoon
Posts: 173
|
Posted: 03/04/2010, 2:09 PM |
|
You can archive this only using custom code;
Place it in After Execute Insert/Update/Delete
Still isn't too much having a checkbox list in an editable grid?
I'll rather make use of a grid and an editable grid / record.
Another thing, how your database structure looks like?
|
|
|
Tim-TPM
Posts: 3
|
Posted: 03/05/2010, 10:25 PM |
|
Thanks dragoon.
About the database structure: I'm trying to insert into a man-to-many table, with a composite PK (similar to the Order, OrderItem, Item design). One of the PK columns' value will come from another page (URL parameter), while the other value contributing in the PK will be inserted if the user selects a checkbox near the row of the item (which aggregates information from several tables using a view).
The user can choose many items, so many records can be inserted or updated.
I thought about the manual insert/update as you suggested, dragoon; but I'm not sure how the code will look like.
I'm thinking about adding a checkbox column to a non-editable grid, such that when the user clicks a submit button, the checkbox status is checked for each row, and if the checkbox is selected, the id value from that row is inserted into the many-to-many table.
I also want the checkboxes to reflect the rows in the database (in edit mode) by appropriately showing which checkboxes are selected and which are not.
I hope you didn't find my above explanation confusing.
I would very much appreciate your help regarding the checkbox properties (especially ControlSource and DataSource) the basic structure of the needed code (which functions will I need...etc.)
Kind regards
Tim
|
|
|
|