Hi all,
I'm building an appointment booking system. I'm allowing the user to create Master Days, with Master Booking Slots, from which they can create date-specific Days with Slots.
Each Master Day can have a different number of slots, so I build the set of textboxes (for start time) and dropdownlists (for services offered at that time) dynamically.
My problem is copying the set of services into each of the dynamic dropdownlists.
I've created a hidden ddl from the database, populated depending upon certain criteria. I then use the following code :
DropDownList ddlCat = (DropDownList)this.pnlMDaySlots.FindControl("ddlCat" + Convert.ToString(i + 1));
DropDownList ddlCat = (DropDownList)this.pnlMDaySlots.FindControl("ddlCat" + Convert.ToString(i + 1));
ddlCat.DataSource = ddlCat_Hidden.Items;
ddlCat.DataBind();
Which copies all the items perfectly, BUT sets the Value to the same as the Item (i.e. the text of the Service), instead of the original database unique ID value which is stored in the hidden ddl.
So, my question is - how do I copy the items from the hidden ddl into each of the dynamic ddls, and preserve the Value and Item contents ???
Any help gratefully received.
Stu
, the number of each is dependant upon a pre-built list