protected void Order(object sender, EventArgs e) { StringBuilder orderedItems = new StringBuilder(); foreach (ListBoxItem item in ListBox1.Items) { OboutCheckBox checkbox = item.FindControl("OboutCheckBox1") as OboutCheckBox; if (checkbox.Checked) { if (orderedItems.Length > 0) { orderedItems.Append(", "); } orderedItems.Append(item.Text); } } if (orderedItems.Length > 0) { OrderDetails.Text = "<br /><br /><br /><b>The following controls have been ordered:</b> " + orderedItems.ToString() + "<br />"; } else { OrderDetails.Text = ""; } }
protected void SuperForm1_DataBound(object sender, EventArgs e) { if (SuperForm1.CurrentMode != DetailsViewMode.ReadOnly) { OboutCheckBox discontinuedChk = SuperForm1.GetFieldControl(2) as OboutCheckBox; discontinuedChk.ClientSideEvents.OnCheckedChanged = "Discontinued_CheckedChanged"; } }
protected void SuperForm1_DataBound(object sender, EventArgs e) { if (SuperForm1.CurrentMode == DetailsViewMode.Insert) { OboutTextBox shipName = (OboutTextBox)(SuperForm1.Rows[1].Cells[1].Controls[0].Controls[0]); shipName.Text = "Default Name"; OboutTextBox shipCity = (OboutTextBox)(SuperForm1.Rows[2].Cells[1].Controls[0].Controls[0]); shipCity.Text = "Default City"; OboutTextBox shipCountry = (OboutTextBox)(SuperForm1.Rows[3].Cells[1].Controls[0].Controls[0]); shipCountry.Text = "Default Country"; OboutTextBox orderDate = (OboutTextBox)(SuperForm1.Rows[4].Cells[1].Controls[0].Controls[0]); orderDate.Text = DateTime.Now.ToString("MM/dd/yyyy"); OboutCheckBox sent = (OboutCheckBox)(SuperForm1.Rows[5].Cells[1].Controls[0]); sent.Checked = true; } }