예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.Title                    = "Employee Form";
        SuperForm1.DataSourceID             = "SqlDataSource1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.Width                    = Unit.Pixel(480);
        SuperForm1.DataKeyNames             = new string[] { "EmployeeID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;

        SuperForm1.ItemUpdating  += SuperForm1_ItemUpdating;
        SuperForm1.ItemInserting += SuperForm1_ItemInserting;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField     = "EmployeeID";
        field1.HeaderText    = "Employee ID:";
        field1.ReadOnly      = true;
        field1.InsertVisible = false;
        field1.Visible       = false;
        field1.FieldSetID    = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "FirstName";
        field2.HeaderText = "First Name:";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "LastName";
        field3.HeaderText = "Last Name:";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.TemplateField field4 = new Obout.SuperForm.TemplateField();
        field4.FieldSetID       = "FieldSet2";
        field4.ItemTemplate     = new TabStripItemTemplate();
        field4.EditItemTemplate = new TabStripEditItemTemplate();

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField  = "City";
        field5.HeaderText = "City:";
        field5.FieldSetID = "FieldSet3";

        Obout.SuperForm.DateField field6 = new Obout.SuperForm.DateField();
        field6.DataField             = "BirthDate";
        field6.HeaderText            = "Birth Date:";
        field6.FieldSetID            = "FieldSet3";
        field6.DataFormatString      = "{0:MM/dd/yyyy}";
        field6.ApplyFormatInEditMode = true;

        Obout.SuperForm.BoundField field7 = new Obout.SuperForm.BoundField();
        field7.DataField  = "Address";
        field7.HeaderText = "Address:";
        field7.FieldSetID = "FieldSet3";

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField             = "HireDate";
        field8.HeaderText            = "Hire Date:";
        field8.FieldSetID            = "FieldSet3";
        field8.DataFormatString      = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        Obout.SuperForm.BoundField field9 = new Obout.SuperForm.BoundField();
        field9.DataField  = "Country";
        field9.HeaderText = "Country:";
        field9.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field10 = new Obout.SuperForm.BoundField();
        field10.DataField  = "Salary";
        field10.HeaderText = "Salary:";
        field10.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field11 = new Obout.SuperForm.BoundField();
        field11.DataField  = "HomePhone";
        field11.HeaderText = "HomePhone:";
        field11.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field12 = new Obout.SuperForm.BoundField();
        field12.DataField  = "Extension";
        field12.HeaderText = "Extension:";
        field12.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field13 = new Obout.SuperForm.BoundField();
        field13.DataField  = "PostalCode";
        field13.HeaderText = "PostalCode:";
        field13.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field14 = new Obout.SuperForm.BoundField();
        field14.DataField  = "Region";
        field14.HeaderText = "Region:";
        field14.FieldSetID = "FieldSet4";

        Obout.SuperForm.TemplateField field15 = new Obout.SuperForm.TemplateField();
        field15.FieldSetID       = "FieldSet5";
        field15.HeaderText       = "Notes:";
        field15.ItemTemplate     = new EditorItemTemplate();
        field15.EditItemTemplate = new EditorEditItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet1    = new Obout.SuperForm.FieldSet();
        fieldSet1.ID        = "FieldSet1";
        fieldSet1.Direction = Direction.Horizontal;
        fieldSet1.CssClass  = "field-set";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet2    = new Obout.SuperForm.FieldSet();
        fieldSet2.ID        = "FieldSet2";
        fieldSet2.Direction = Direction.Horizontal;
        fieldSet2.CssClass  = "field-set";
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow3 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet3    = new Obout.SuperForm.FieldSet();
        fieldSet3.ID        = "FieldSet3";
        fieldSet3.Direction = Direction.Horizontal;
        fieldSet3.CssClass  = "field-set field-set-visible";
        fieldSetRow3.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow4 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet4    = new Obout.SuperForm.FieldSet();
        fieldSet4.ID        = "FieldSet4";
        fieldSet4.Direction = Direction.Horizontal;
        fieldSet4.CssClass  = "field-set field-set-hidden";
        fieldSetRow4.Items.Add(fieldSet4);

        Obout.SuperForm.FieldSetRow fieldSetRow5 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet5    = new Obout.SuperForm.FieldSet();
        fieldSet5.ID        = "FieldSet5";
        fieldSet5.Direction = Direction.Horizontal;
        fieldSet5.CssClass  = "field-set field-set-hidden-editor";
        fieldSetRow5.Items.Add(fieldSet5);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow3);
        SuperForm1.FieldSets.Add(fieldSetRow4);
        SuperForm1.FieldSets.Add(fieldSetRow5);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);
        SuperForm1.Fields.Add(field15);
        SuperForm1.FieldHeaderStyle.Width = Unit.Pixel(200);
        SuperForm1Container.Controls.Add(SuperForm1);
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                       = new SuperForm();
        SuperForm1.ID                    = "SuperForm1";
        SuperForm1.Title                 = "Order Details";
        SuperForm1.DataSourceID          = "SqlDataSource1";
        SuperForm1.AutoGenerateRows      = false;
        SuperForm1.DataKeyNames          = new string[] { "OrderID" };
        SuperForm1.AllowPaging           = true;
        SuperForm1.AllowDataKeysInsert   = false;
        SuperForm1.EnableModelValidation = true;
        SuperForm1.DefaultMode           = DetailsViewMode.Edit;
        SuperForm1.ModeChanged          += SuperForm1_ModeChanged;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField     = "OrderID";
        field1.HeaderText    = "Order ID";
        field1.ReadOnly      = true;
        field1.InsertVisible = false;
        field1.FieldSetID    = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "ShipName";
        field2.HeaderText = "Ship Name";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField  = "ShipCountry";
        field4.HeaderText = "Ship Country";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.CommandField field5 = new Obout.SuperForm.CommandField();
        field5.ButtonType       = ButtonType.Button;
        field5.ShowEditButton   = true;
        field5.ShowDeleteButton = true;
        field5.ShowInsertButton = true;
        field5.FieldSetID       = "FieldSet2";

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet1    = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet2    = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.HorizontalAlign = HorizontalAlign.NotSet;
        fieldSet2.CssClass        = "hidden-buttons";
        fieldSetRow2.Items.Add(fieldSet2);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);


        SuperForm1Container.Controls.Add(SuperForm1);

        if (!IsPostBack)
        {
            UpdateButtonsState();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.Title = "Employee Form";
        SuperForm1.DataSourceID = "SqlDataSource1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.Width = Unit.Pixel(480);
        SuperForm1.DataKeyNames = new string[] { "EmployeeID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;

        SuperForm1.ItemUpdating += SuperForm1_ItemUpdating;
        SuperForm1.ItemInserting += SuperForm1_ItemInserting;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "EmployeeID";
        field1.HeaderText = "Employee ID:";
        field1.ReadOnly = true;
        field1.InsertVisible = false;
        field1.Visible= false;
        field1.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "FirstName";
        field2.HeaderText = "First Name:";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "LastName";
        field3.HeaderText = "Last Name:";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.TemplateField field4 = new Obout.SuperForm.TemplateField();
        field4.FieldSetID = "FieldSet2";
        field4.ItemTemplate = new TabStripItemTemplate();
        field4.EditItemTemplate = new TabStripEditItemTemplate();

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField = "City";
        field5.HeaderText = "City:";
        field5.FieldSetID = "FieldSet3";

        Obout.SuperForm.DateField field6 = new Obout.SuperForm.DateField();
        field6.DataField = "BirthDate";
        field6.HeaderText = "Birth Date:";
        field6.FieldSetID = "FieldSet3";
        field6.DataFormatString = "{0:MM/dd/yyyy}";
        field6.ApplyFormatInEditMode = true;

        Obout.SuperForm.BoundField field7 = new Obout.SuperForm.BoundField();
        field7.DataField = "Address";
        field7.HeaderText = "Address:";
        field7.FieldSetID = "FieldSet3";

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField = "HireDate";
        field8.HeaderText = "Hire Date:";
        field8.FieldSetID = "FieldSet3";
        field8.DataFormatString = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        Obout.SuperForm.BoundField field9 = new Obout.SuperForm.BoundField();
        field9.DataField = "Country";
        field9.HeaderText = "Country:";
        field9.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field10 = new Obout.SuperForm.BoundField();
        field10.DataField = "Salary";
        field10.HeaderText = "Salary:";
        field10.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field11 = new Obout.SuperForm.BoundField();
        field11.DataField = "HomePhone";
        field11.HeaderText = "HomePhone:";
        field11.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field12 = new Obout.SuperForm.BoundField();
        field12.DataField = "Extension";
        field12.HeaderText = "Extension:";
        field12.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field13 = new Obout.SuperForm.BoundField();
        field13.DataField = "PostalCode";
        field13.HeaderText = "PostalCode:";
        field13.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field14 = new Obout.SuperForm.BoundField();
        field14.DataField = "Region";
        field14.HeaderText = "Region:";
        field14.FieldSetID = "FieldSet4";

        Obout.SuperForm.TemplateField field15 = new Obout.SuperForm.TemplateField();
        field15.FieldSetID = "FieldSet5";
        field15.HeaderText = "Notes:";
        field15.ItemTemplate = new EditorItemTemplate();
        field15.EditItemTemplate = new EditorEditItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet1 = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSet1.Direction = Direction.Horizontal;
        fieldSet1.CssClass = "field-set";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Direction = Direction.Horizontal;
        fieldSet2.CssClass = "field-set";
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow3 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.Direction = Direction.Horizontal;
        fieldSet3.CssClass = "field-set field-set-visible";
        fieldSetRow3.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow4 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID = "FieldSet4";
        fieldSet4.Direction = Direction.Horizontal;
        fieldSet4.CssClass = "field-set field-set-hidden";
        fieldSetRow4.Items.Add(fieldSet4);

        Obout.SuperForm.FieldSetRow fieldSetRow5 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet5 = new Obout.SuperForm.FieldSet();
        fieldSet5.ID = "FieldSet5";
        fieldSet5.Direction = Direction.Horizontal;
        fieldSet5.CssClass = "field-set field-set-hidden-editor";
        fieldSetRow5.Items.Add(fieldSet5);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow3);
        SuperForm1.FieldSets.Add(fieldSetRow4);
        SuperForm1.FieldSets.Add(fieldSetRow5);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);
        SuperForm1.Fields.Add(field15);
        SuperForm1.FieldHeaderStyle.Width = Unit.Pixel(200);
        SuperForm1Container.Controls.Add(SuperForm1);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.Title                    = "Add new order";
        SuperForm1.DataSourceID             = "SqlDataSource1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Insert;
        SuperForm1.Width                    = Unit.Pixel(480);
        SuperForm1.ItemUpdating            += SuperForm1_ItemUpdating;
        SuperForm1.ItemInserting           += SuperForm1_ItemInserting;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField     = "OrderID";
        field1.HeaderText    = "Order ID";
        field1.ReadOnly      = true;
        field1.InsertVisible = false;
        field1.FieldSetID    = "FieldSet1";
        field1.Visible       = false;

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "ShipName";
        field2.HeaderText = "Ship Name";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";


        Obout.SuperForm.DateField field4 = new Obout.SuperForm.DateField();
        field4.DataField             = "OrderDate";
        field4.HeaderText            = "Order Date";
        field4.DataFormatString      = "{0:MM/dd/yyyy}";
        field4.ApplyFormatInEditMode = true;
        field4.FieldSetID            = "FieldSet2";

        Obout.SuperForm.DropDownListField field5 = new Obout.SuperForm.DropDownListField();
        field5.DataField    = "ShipCountry";
        field5.HeaderText   = "Country";
        field5.DisplayField = "ShipCountry";
        field5.DataSourceID = "SqlDataSource2";
        field5.FieldSetID   = "FieldSet2";

        Obout.SuperForm.TemplateField field6 = new Obout.SuperForm.TemplateField();
        field6.HeaderText       = "Details";
        field6.FieldSetID       = "FieldSet3";
        field6.ItemTemplate     = new DetailsItemTemplate();
        field6.EditItemTemplate = new DetailsEditItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet1    = new Obout.SuperForm.FieldSet();
        fieldSet1.ID        = "FieldSet1";
        fieldSet1.Direction = Direction.Horizontal;
        fieldSet1.CssClass  = "field-set";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet2    = new Obout.SuperForm.FieldSet();
        fieldSet2.ID        = "FieldSet2";
        fieldSet2.Direction = Direction.Horizontal;
        fieldSet2.CssClass  = "field-set";
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow3 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet3    = new Obout.SuperForm.FieldSet();
        fieldSet3.ID        = "FieldSet3";
        fieldSet3.Direction = Direction.Horizontal;
        fieldSet3.CssClass  = "field-set";
        fieldSetRow3.Items.Add(fieldSet3);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow3);

        SuperForm1.FieldHeaderStyle.Width = Unit.Pixel(200);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);

        SuperForm1Container.Controls.Add(SuperForm1);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1    = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.Width            = Unit.Pixel(630);
        SuperForm1.Title            = "Payment Information";
        SuperForm1.FolderStyle      = "styles/black_glass";

        SuperForm1.DefaultMode    = DetailsViewMode.Insert;
        SuperForm1.ItemInserting += SuperForm1_Inserting;
        SuperForm1.DataBound     += SuperForm1_DataBound;

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField          = "CardNumber";
        field5.HeaderText         = "Card Number";
        field5.FieldSetID         = "FieldSet2";
        field5.Required           = true;
        field5.ControlStyle.Width = Unit.Pixel(150);

        /*MaskedEditExtender extender1 = new MaskedEditExtender();
         * extender1.ID = "MaskedEditExtender1";
         * extender1.Mask = "9999-9999-9999-9999";
         * extender1.MessageValidatorTip = true;
         * extender1.MaskType = MaskedEditType.Number;
         * field5.Masks.Add(extender1);*/

        Obout.SuperForm.DropDownListField field6 = new Obout.SuperForm.DropDownListField();
        field6.DataField          = "ExpirationYear";
        field6.HeaderText         = "Expiration Year";
        field6.FieldSetID         = "FieldSet2";
        field6.ControlStyle.Width = 93;
        field6.Required           = true;

        Obout.SuperForm.DropDownListField field7 = new Obout.SuperForm.DropDownListField();
        field7.DataField          = "ExpirationMonth";
        field7.HeaderText         = "ExpirationMonth";
        field7.FieldSetID         = "FieldSet2";
        field7.ControlStyle.Width = 117;
        field7.Required           = true;

        Obout.SuperForm.BoundField field8 = new Obout.SuperForm.BoundField();
        field8.DataField          = "CIN";
        field8.HeaderText         = "Security Code";
        field8.FieldSetID         = "FieldSet2";
        field8.ControlStyle.Width = 83;
        field8.Required           = true;
        field8.MaxLength          = 3;

        /*FilteredTextBoxExtender numbers = new FilteredTextBoxExtender();
         * numbers.FilterType = FilterTypes.Numbers;
         * field8.Filters.Add(numbers);*/

        Obout.SuperForm.TemplateField dummyField = new Obout.SuperForm.TemplateField();
        dummyField.FieldSetID      = "FieldSet3";
        dummyField.ItemTemplate    = new DummyItemTemplate();
        dummyField.ItemStyle.Width = 150;

        Obout.SuperForm.CheckBoxField field4 = new Obout.SuperForm.CheckBoxField();
        field4.DataField       = "SameAsBilling";
        field4.FieldSetID      = "FieldSet4";
        field4.Text            = "Same as the billing";
        field4.FieldsToDisable = "UserCompanyName";
        field4.FieldsToDisable = "UserCompanyName,UserFirstName,UserLastName,UserEmailAddress,UserAddress,UserCountryID,UserStateID,UserProvince,UserZip,UserVatID,UserPhone,UserFax";
        field4.ItemStyle.Width = 150;

        Obout.SuperForm.BoundField field9 = new Obout.SuperForm.BoundField();
        field9.DataField  = "BillingCompanyName";
        field9.HeaderText = "Company Name";
        field9.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field10 = new Obout.SuperForm.BoundField();
        field10.DataField  = "BillingFirstName";
        field10.HeaderText = "First Name";
        field10.FieldSetID = "FieldSet3";
        field10.Required   = true;

        Obout.SuperForm.BoundField field11 = new Obout.SuperForm.BoundField();
        field11.DataField  = "BillingLastName";
        field11.HeaderText = "Last Name";
        field11.FieldSetID = "FieldSet3";
        field11.Required   = true;

        Obout.SuperForm.BoundField field12 = new Obout.SuperForm.BoundField();
        field12.DataField  = "BillingEmailAddress";
        field12.HeaderText = "Email Address";
        field12.FieldSetID = "FieldSet3";
        field12.Required   = true;

        Obout.SuperForm.MultiLineField field13 = new Obout.SuperForm.MultiLineField();
        field13.DataField  = "BillingAddress";
        field13.HeaderText = "Address";
        field13.FieldSetID = "FieldSet3";
        field13.Required   = true;

        Obout.SuperForm.DropDownListField field14 = new Obout.SuperForm.DropDownListField();
        field14.DataField       = "BillingCountryID";
        field14.HeaderText      = "Country";
        field14.FieldSetID      = "FieldSet3";
        field14.Required        = true;
        field14.DataSourceID    = "CountriesDataSource";
        field14.DataValueField  = "CountryID";
        field14.DataTextField   = "CountryName";
        field14.Default         = "219";
        field14.FieldsToEnable  = "BillingStateID";
        field14.EnablingValues  = "219";
        field14.FieldsToDisable = "BillingProvince";
        field14.DisablingValues = "219";

        Obout.SuperForm.DropDownListField field15 = new Obout.SuperForm.DropDownListField();
        field15.DataField      = "BillingStateID";
        field15.HeaderText     = "State";
        field15.FieldSetID     = "FieldSet3";
        field15.Required       = true;
        field15.DataSourceID   = "StatesDataSource";
        field15.DataValueField = "State";
        field15.DataTextField  = "State";

        Obout.SuperForm.BoundField field16 = new Obout.SuperForm.BoundField();
        field16.DataField  = "BillingProvince";
        field16.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field17 = new Obout.SuperForm.BoundField();
        field17.DataField  = "BillingZip";
        field17.HeaderText = "Zip Code / Postal Code";
        field17.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field18 = new Obout.SuperForm.BoundField();
        field18.DataField  = "BillingVatID";
        field18.HeaderText = "VAT Exemption ID";
        field18.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field19 = new Obout.SuperForm.BoundField();
        field19.DataField  = "BillingPhone";
        field19.HeaderText = "Phone";
        field19.FieldSetID = "FieldSet3";

        /*MaskedEditExtender extender2 = new MaskedEditExtender();
         * extender2.ID = "MaskedEditExtender2";
         * extender2.Mask = "(999)999-9999";
         * extender2.MaskType = MaskedEditType.Number;
         * field19.Masks.Add(extender2);*/

        Obout.SuperForm.BoundField field20 = new Obout.SuperForm.BoundField();
        field20.DataField  = "BillingFax";
        field20.HeaderText = "Fax";
        field20.FieldSetID = "FieldSet3";

        /*MaskedEditExtender extender3 = new MaskedEditExtender();
         * extender3.ID = "MaskedEditExtender3";
         * extender3.Mask = "(999)999-9999";
         * extender3.MaskType = MaskedEditType.Number;
         * field20.Masks.Add(extender3);*/

        Obout.SuperForm.BoundField field21 = new Obout.SuperForm.BoundField();
        field21.DataField  = "UserCompanyName";
        field21.HeaderText = "Company Name";
        field21.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field22 = new Obout.SuperForm.BoundField();
        field22.DataField  = "UserFirstName";
        field22.HeaderText = "First Name";
        field22.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field23 = new Obout.SuperForm.BoundField();
        field23.DataField  = "UserLastName";
        field23.HeaderText = "Last Name";
        field23.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field24 = new Obout.SuperForm.BoundField();
        field24.DataField  = "UserEmailAddress";
        field24.HeaderText = "Email Address";
        field24.FieldSetID = "FieldSet4";

        Obout.SuperForm.MultiLineField field25 = new Obout.SuperForm.MultiLineField();
        field25.DataField  = "UserAddress";
        field25.HeaderText = "Address";
        field25.FieldSetID = "FieldSet4";

        Obout.SuperForm.DropDownListField field26 = new Obout.SuperForm.DropDownListField();
        field26.DataField  = "UserCountryID";
        field26.HeaderText = "Country";
        field26.FieldSetID = "FieldSet4";

        field26.DataSourceID    = "CountriesDataSource";
        field26.DataValueField  = "CountryID";
        field26.DataTextField   = "CountryName";
        field26.Default         = "219";
        field26.FieldsToEnable  = "UserStateID";
        field26.EnablingValues  = "219";
        field26.FieldsToDisable = "UserProvince";
        field26.DisablingValues = "219";

        Obout.SuperForm.DropDownListField field27 = new Obout.SuperForm.DropDownListField();
        field27.DataField  = "UserStateID";
        field27.HeaderText = "State";
        field27.FieldSetID = "FieldSet4";

        field27.DataSourceID   = "StatesDataSource";
        field27.DataValueField = "State";
        field27.DataTextField  = "State";


        Obout.SuperForm.BoundField field28 = new Obout.SuperForm.BoundField();
        field28.DataField  = "UserProvince";
        field28.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field29 = new Obout.SuperForm.BoundField();
        field29.DataField  = "UserZip";
        field29.FieldSetID = "FieldSet4";
        field29.HeaderText = "Zip Code / Postal Code";

        Obout.SuperForm.BoundField field30 = new Obout.SuperForm.BoundField();
        field30.DataField  = "UserVatID";
        field30.FieldSetID = "FieldSet4";
        field30.HeaderText = "VAT Exemption ID";

        Obout.SuperForm.BoundField field31 = new Obout.SuperForm.BoundField();
        field31.DataField  = "UserPhone";
        field31.FieldSetID = "FieldSet4";
        field31.HeaderText = "Phone";

        /*MaskedEditExtender extender4 = new MaskedEditExtender();
         * extender4.ID = "MaskedEditExtender4";
         * extender4.Mask = "(999)999-9999";
         * extender4.MaskType = MaskedEditType.Number;
         * field31.Masks.Add(extender4);*/

        Obout.SuperForm.BoundField field32 = new Obout.SuperForm.BoundField();
        field32.DataField  = "UserFax";
        field32.HeaderText = "Fax";
        field32.FieldSetID = "FieldSet4";

        /*MaskedEditExtender extender5 = new MaskedEditExtender();
         * extender5.ID = "MaskedEditExtender5";
         * extender5.Mask = "(999)999-9999";
         * extender5.MaskType = MaskedEditType.Number;
         * field32.Masks.Add(extender5);*/

        Obout.SuperForm.CommandField field33 = new Obout.SuperForm.CommandField();
        field33.ShowInsertButton          = true;
        field33.InsertText                = "Buy Now";
        field33.ShowCancelButton          = false;
        field33.ButtonType                = ButtonType.Button;
        field33.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        field33.FieldSetID                = "CommandFields";

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet2    = new Obout.SuperForm.FieldSet();
        fieldSet2.ID         = "FieldSet2";
        fieldSet2.Direction  = Direction.Horizontal;
        fieldSet2.ColumnSpan = 2;
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow4 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet3    = new Obout.SuperForm.FieldSet();
        fieldSet3.ID    = "FieldSet3";
        fieldSet3.Title = "Billing Information";

        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID    = "FieldSet4";
        fieldSet4.Title = "End-User Information";

        fieldSetRow4.Items.Add(fieldSet3);
        fieldSetRow4.Items.Add(fieldSet4);

        Obout.SuperForm.FieldSetRow fieldSetRow5  = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    commandFields = new Obout.SuperForm.FieldSet();
        commandFields.ID = "CommandFields";
        commandFields.HorizontalAlign = HorizontalAlign.Center;
        commandFields.ColumnSpan      = 2;
        fieldSetRow5.Items.Add(commandFields);

        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow4);
        SuperForm1.FieldSets.Add(fieldSetRow5);

        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(dummyField);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);
        SuperForm1.Fields.Add(field15);
        SuperForm1.Fields.Add(field16);
        SuperForm1.Fields.Add(field17);
        SuperForm1.Fields.Add(field18);
        SuperForm1.Fields.Add(field19);
        SuperForm1.Fields.Add(field20);
        SuperForm1.Fields.Add(field21);
        SuperForm1.Fields.Add(field22);
        SuperForm1.Fields.Add(field23);
        SuperForm1.Fields.Add(field24);
        SuperForm1.Fields.Add(field25);
        SuperForm1.Fields.Add(field26);
        SuperForm1.Fields.Add(field27);
        SuperForm1.Fields.Add(field28);
        SuperForm1.Fields.Add(field29);
        SuperForm1.Fields.Add(field30);
        SuperForm1.Fields.Add(field31);
        SuperForm1.Fields.Add(field32);
        SuperForm1.Fields.Add(field33);

        SuperForm1Container.Controls.Add(SuperForm1);
    }
예제 #6
0
    public void CreatetplRowEdit(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder ph1 = new PlaceHolder();

        e.Container.Controls.Add(ph1);

        Literal inputText = new Literal();

        inputText.Text = "<input type=\"hidden\" id=\"OrderID\" />";

        ValidationSummary validateGroup1 = new ValidationSummary();

        validateGroup1.ID = "ValidationSummary1";
        validateGroup1.ValidationGroup = "Group1";

        ph1.Controls.Add(inputText);
        ph1.Controls.Add(validateGroup1);

        SuperForm1    = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton   = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.ValidationGroup          = "Group1";
        SuperForm1.Width        = Unit.Percentage(99);
        SuperForm1.DataKeyNames = new string[] { "Order ID" };
        SuperForm1.DefaultMode  = DetailsViewMode.Insert;

        RequiredFieldValidator requiredFieldValidator1 = new RequiredFieldValidator();

        requiredFieldValidator1.ID              = "RequiredFieldValidator1";
        requiredFieldValidator1.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator1.ErrorMessage    = "Ship Name is mandatory";
        requiredFieldValidator1.Text            = "*";
        requiredFieldValidator1.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator2 = new RequiredFieldValidator();

        requiredFieldValidator2.ID              = "RequiredFieldValidator2";
        requiredFieldValidator2.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator2.ErrorMessage    = "Ship Address is mandatory";
        requiredFieldValidator2.Text            = "*";
        requiredFieldValidator2.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator3 = new RequiredFieldValidator();

        requiredFieldValidator3.ID              = "RequiredFieldValidator3";
        requiredFieldValidator3.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator3.ErrorMessage    = "Ship City is mandatory";
        requiredFieldValidator3.Text            = "*";
        requiredFieldValidator3.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator4 = new RequiredFieldValidator();

        requiredFieldValidator4.ID              = "RequiredFieldValidator4";
        requiredFieldValidator4.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator4.ErrorMessage    = "Ship Country is mandatory";
        requiredFieldValidator4.Text            = "*";
        requiredFieldValidator4.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator5 = new RequiredFieldValidator();

        requiredFieldValidator5.ID              = "RequiredFieldValidator5";
        requiredFieldValidator5.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator5.ErrorMessage    = "Order Date is mandatory";
        requiredFieldValidator5.Text            = "*";
        requiredFieldValidator5.ValidationGroup = "Group1";

        RangeValidator rangeValidator1 = new RangeValidator();

        rangeValidator1.ID              = "RangeValidator1";
        rangeValidator1.Display         = ValidatorDisplay.Dynamic;
        rangeValidator1.MinimumValue    = "1900/1/1";
        rangeValidator1.MaximumValue    = "2039/12/31";
        rangeValidator1.Type            = ValidationDataType.Date;
        rangeValidator1.ErrorMessage    = "Order Date needs to be in this format: mm/dd/yyyy";
        rangeValidator1.Text            = "*";
        rangeValidator1.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator6 = new RequiredFieldValidator();

        requiredFieldValidator6.ID              = "RequiredFieldValidator6";
        requiredFieldValidator6.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator6.ErrorMessage    = "Required Date is mandatory";
        requiredFieldValidator6.Text            = "*";
        requiredFieldValidator6.ValidationGroup = "Group1";

        RangeValidator rangeValidator2 = new RangeValidator();

        rangeValidator2.ID              = "RangeValidator2";
        rangeValidator2.Display         = ValidatorDisplay.Dynamic;
        rangeValidator2.MinimumValue    = "1900/1/1";
        rangeValidator2.MaximumValue    = "2039/12/31";
        rangeValidator2.Type            = ValidationDataType.Date;
        rangeValidator2.ErrorMessage    = "Required Date needs to be in this format: mm/dd/yyyy";
        rangeValidator2.Text            = "*";
        rangeValidator2.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator7 = new RequiredFieldValidator();

        requiredFieldValidator7.ID              = "RequiredFieldValidator7";
        requiredFieldValidator7.Display         = ValidatorDisplay.Dynamic;
        requiredFieldValidator7.ErrorMessage    = "Shipped Date is mandatory";
        requiredFieldValidator7.Text            = "*";
        requiredFieldValidator7.ValidationGroup = "Group1";

        RangeValidator rangeValidator3 = new RangeValidator();

        rangeValidator3.ID              = "RangeValidator3";
        rangeValidator3.Display         = ValidatorDisplay.Dynamic;
        rangeValidator3.MinimumValue    = "1900/1/1";
        rangeValidator3.MaximumValue    = "2039/12/31";
        rangeValidator3.Type            = ValidationDataType.Date;
        rangeValidator3.ErrorMessage    = "Shipped Date needs to be in this format: mm/dd/yyyy";
        rangeValidator3.Text            = "*";
        rangeValidator3.ValidationGroup = "Group1";

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField  = "ShipName";
        field1.HeaderText = "Ship Name";
        field1.FieldSetID = "FieldSet1";
        field1.Validators.Add(requiredFieldValidator1);

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "ShipAddress";
        field2.HeaderText = "Ship Address";
        field2.FieldSetID = "FieldSet1";
        field2.Validators.Add(requiredFieldValidator2);

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";
        field3.Validators.Add(requiredFieldValidator3);

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField  = "ShipRegion";
        field4.HeaderText = "Ship Region";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField  = "ShipPostalCode";
        field5.HeaderText = "Zip Cod";
        field5.FieldSetID = "FieldSet1";

        Obout.SuperForm.DropDownListField field6 = new Obout.SuperForm.DropDownListField();
        field6.DataField    = "ShipCountry";
        field6.HeaderText   = "Ship Country";
        field6.FieldSetID   = "FieldSet1";
        field6.DataSourceID = "SqlDataSource3";
        field6.Validators.Add(requiredFieldValidator4);

        Obout.SuperForm.DateField field7 = new Obout.SuperForm.DateField();
        field7.DataField             = "OrderDate";
        field7.HeaderText            = "Order Date";
        field7.FieldSetID            = "FieldSet2";
        field7.DataFormatString      = "{0:MM/dd/yyyy}";
        field7.ApplyFormatInEditMode = true;
        field7.Validators.Add(requiredFieldValidator5);
        field7.Validators.Add(rangeValidator1);

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField             = "RequiredDate";
        field8.HeaderText            = "Required Date";
        field8.FieldSetID            = "FieldSet2";
        field8.DataFormatString      = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;
        field8.Validators.Add(requiredFieldValidator6);
        field8.Validators.Add(rangeValidator2);

        Obout.SuperForm.DateField field9 = new Obout.SuperForm.DateField();
        field9.DataField             = "ShippedDate";
        field9.HeaderText            = "Shipped Date";
        field9.FieldSetID            = "FieldSet2";
        field9.DataFormatString      = "{0:MM/dd/yyyy}";
        field9.ApplyFormatInEditMode = true;
        field9.Validators.Add(requiredFieldValidator7);
        field9.Validators.Add(rangeValidator3);

        Obout.SuperForm.BoundField field10 = new Obout.SuperForm.BoundField();
        field10.DataField  = "ShipVia";
        field10.HeaderText = "Ship Via";
        field10.FieldSetID = "FieldSet2";

        Obout.SuperForm.CheckBoxField field11 = new Obout.SuperForm.CheckBoxField();
        field11.DataField  = "Sent";
        field11.HeaderText = "Sent";
        field11.FieldSetID = "FieldSet2";

        Obout.SuperForm.MultiLineField field12 = new Obout.SuperForm.MultiLineField();
        field12.DataField         = "AdditionalInformation";
        field12.HeaderText        = "";
        field12.FieldSetID        = "FieldSet3";
        field12.HeaderStyle.Width = 1;

        Obout.SuperForm.TemplateField field13 = new Obout.SuperForm.TemplateField();
        field13.FieldSetID       = "FieldSet4";
        field13.EditItemTemplate = new btnUpdateEditItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet1    = new Obout.SuperForm.FieldSet();
        fieldSet1.ID    = "FieldSet1";
        fieldSet1.Title = "Ship Information";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID    = "FieldSet2";
        fieldSet2.Title = "Order Information";
        fieldSetRow1.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID    = "FieldSet3";
        fieldSet3.Title = "Additional Information";
        fieldSetRow1.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet4    = new Obout.SuperForm.FieldSet();
        fieldSet4.ID         = "FieldSet4";
        fieldSet4.ColumnSpan = 3;
        fieldSet4.CssClass   = "command-row";
        fieldSetRow2.Items.Add(fieldSet4);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);


        ph1.Controls.Add(SuperForm1);
    }
    protected void DataBindRowEditTemplate(Object sender, EventArgs e)
    {
        PlaceHolder oPH1 = sender as PlaceHolder;
        Obout.Grid.TemplateContainer oContainer = oPH1.NamingContainer as Obout.Grid.TemplateContainer;

        Literal hiddenInput = new Literal();
        hiddenInput.Text = "<input type=\"hidden\" id=\"OrderID\" />";

        SuperForm SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.DataSourceID = "SqlDataSource2";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.AutoGenerateDateFields = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.Width = Unit.Percentage(99);
        SuperForm1.DefaultMode = DetailsViewMode.Insert;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "OrderID";
        field1.HeaderText = "Order ID";
        field1.ReadOnly = true;
        field1.InsertVisible = false;
        field1.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "ShipName";
        field2.HeaderText = "Ship Name";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "ShipAddress";
        field3.HeaderText = "Ship Address";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField = "ShipCity";
        field4.HeaderText = "Ship City";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField = "ShipRegion";
        field5.HeaderText = "Ship Region";
        field5.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField = "ShipPostalCode";
        field6.HeaderText = "Zip Code";
        field6.FieldSetID = "FieldSet1";

        Obout.SuperForm.DropDownListField field7 = new Obout.SuperForm.DropDownListField();
        field7.DataField = "ShipCountry";
        field7.HeaderText = "Ship Country";
        field7.FieldSetID = "FieldSet1";
        field7.DataSourceID = "SqlDataSource3";

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField = "OrderDate";
        field8.HeaderText = "Order Date";
        field8.FieldSetID = "FieldSet2";
        field8.DataFormatString = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field9 = new Obout.SuperForm.DateField();
        field9.DataField = "RequiredDate";
        field9.HeaderText = "Required Date";
        field9.FieldSetID = "FieldSet2";
        field9.DataFormatString = "{0:MM/dd/yyyy}";
        field9.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field10 = new Obout.SuperForm.DateField();
        field10.DataField = "ShippedDate";
        field10.HeaderText = "Shipped Date";
        field10.FieldSetID = "FieldSet2";
        field10.DataFormatString = "{0:MM/dd/yyyy}";
        field10.ApplyFormatInEditMode = true;

        Obout.SuperForm.BoundField field11 = new Obout.SuperForm.BoundField();
        field11.DataField = "ShipVia";
        field11.HeaderText = "Ship Via";
        field11.FieldSetID = "FieldSet2";

        Obout.SuperForm.CheckBoxField field12 = new Obout.SuperForm.CheckBoxField();
        field12.DataField = "Sent";
        field12.HeaderText = "Sent";
        field12.FieldSetID = "FieldSet2";

        Obout.SuperForm.MultiLineField field13 = new Obout.SuperForm.MultiLineField();
        field13.DataField = "AdditionalInformation";
        field13.HeaderText = "Additional Information";
        field13.FieldSetID = "FieldSet3";
        field13.HeaderStyle.Width = 1;

        Obout.SuperForm.TemplateField field14 = new Obout.SuperForm.TemplateField();
        field14.FieldSetID = "FieldSet4";
        field14.EditItemTemplate = new ButtonsEditItemTemplate();
        
        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet1 = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSet1.Title = "Ship Information";
       

        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Title = "Order Information";
       

        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.Title = "Additional Information";

        fieldSetRow1.Items.Add(fieldSet1);
        fieldSetRow1.Items.Add(fieldSet2);
        fieldSetRow1.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID = "FieldSet4";
        fieldSet4.ColumnSpan= 3;
        fieldSet4.CssClass="command-row";
        fieldSetRow2.Items.Add(fieldSet4);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);

        oPH1.Controls.Add(hiddenInput);
        oPH1.Controls.Add(SuperForm1);
    }
    void Page_load(object sender, EventArgs e)
    {
        grid1 = new Grid();
        grid1.ID = "Grid1";
        grid1.DataSourceID = "SqlDataSource1";
        grid1.Serialize = false;
        grid1.AutoGenerateColumns = false;
        grid1.ClientSideEvents.OnBeforeClientEdit = "Grid1_ClientEdit";
        grid1.ClientSideEvents.OnBeforeClientAdd = "Grid1_ClientAdd";
        grid1.ClientSideEvents.ExposeSender = true;

        // creating the columns
        Column oCol1 = new Column();
        oCol1.ID = "Column1";
        oCol1.DataField = "OrderID";
        oCol1.ReadOnly = true;
        oCol1.HeaderText = "ORDER ID";
        oCol1.Width = "150";
        oCol1.Visible = false;

        Column oCol2 = new Column();
        oCol2.ID = "Column2";
        oCol2.DataField = "ShipName";
        oCol2.HeaderText = "NAME";
        oCol2.Width = "200";

        Column oCol3 = new Column();
        oCol3.ID = "Column3";
        oCol3.DataField = "ShipAddress";
        oCol3.Visible = false;
        oCol3.HeaderText = "ADDRESS";
        oCol3.Width = "125";

        Column oCol4 = new Column();
        oCol4.ID = "Column4";
        oCol4.DataField = "ShipCity";
        oCol4.HeaderText = "CITY";
        oCol4.Width = "150";

        Column oCol5 = new Column();
        oCol5.ID = "Column5";
        oCol5.DataField = "ShipRegion";
        oCol5.Visible = false;
        oCol5.HeaderText = "REGION";
        oCol5.Width = "150";

        Column oCol6 = new Column();
        oCol6.ID = "Column6";
        oCol6.DataField = "ShipPostalCode";
        oCol6.HeaderText = "POSTAL CODE";
        oCol6.Width = "150";

        Column oCol7 = new Column();
        oCol7.ID = "Column7";
        oCol7.DataField = "ShipCountry";
        oCol7.HeaderText = "COUNTRY";
        oCol7.Width = "125";

        Column oCol8 = new Column();
        oCol8.ID = "Column8";
        oCol8.DataField = "OrderDate";
        oCol8.HeaderText = "ORDER DATE";
        oCol8.Width = "125";
        oCol8.DataFormatString = "{0:MM/dd/yyyy}";
        oCol8.ApplyFormatInEditMode = true;

        Column oCol9 = new Column();
        oCol9.ID = "Column9";
        oCol9.DataField = "RequiredDate";
        oCol9.Visible = false;
        oCol9.HeaderText = "REQUIRED DATE";
        oCol9.ApplyFormatInEditMode = true;
        oCol9.DataFormatString = "{0:MM/dd/yyyy}";
        oCol9.Width = "200";

        Column oCol10 = new Column();
        oCol10.ID = "Column10";
        oCol10.DataField = "ShippedDate";
        oCol10.Visible = false;
        oCol10.ApplyFormatInEditMode = true;
        oCol10.DataFormatString = "{0:MM/dd/yyyy}";
        oCol10.HeaderText = "SHIPPED DATE";
        oCol10.Width = "200";

        Column oCol11 = new Column();
        oCol11.ID = "Column11";
        oCol11.DataField = "ShipVia";
        oCol11.Visible = false;
        oCol11.HeaderText = "SHIP VIA";
        oCol11.Width = "200";

        Column oCol12 = new Column();
        oCol12.ID = "Column12";
        oCol12.DataField = "Sent";
        oCol12.Visible = false;
        oCol12.HeaderText = "SENT";
        oCol12.Width = "175";

        Column oCol13 = new Column();
        oCol13.DataField = "";
        oCol13.ID = "Column12";
        oCol13.HeaderText = "EDIT";
        oCol13.Width = "150";
        oCol13.AllowEdit = true;
        oCol13.AllowDelete = true;


        // add the columns to the Columns collection of the grid
        grid1.Columns.Add(oCol1);
        grid1.Columns.Add(oCol2);
        grid1.Columns.Add(oCol3);
        grid1.Columns.Add(oCol4);
        grid1.Columns.Add(oCol5);
        grid1.Columns.Add(oCol6);
        grid1.Columns.Add(oCol7);
        grid1.Columns.Add(oCol8);
        grid1.Columns.Add(oCol9);
        grid1.Columns.Add(oCol10);
        grid1.Columns.Add(oCol11);
        grid1.Columns.Add(oCol12);
        grid1.Columns.Add(oCol13);

        // add the grid to the controls collection of the PlaceHolder        
        Grid1Container.Controls.Add(grid1);


        window1 = new Window();
        window1.ID = "Window1";
        window1.IsModal = true;
        window1.ShowCloseButton = true;
        window1.Status = "";
        window1.RelativeElementID = "WindowPositionHelper";
        window1.Top = -25;
        window1.Left = 100;
        window1.Height = 370;
        window1.Width = 551;
        window1.VisibleOnLoad = false;
        window1.StyleFolder = "../window/wdstyles/blue";
        window1.Title = "Add / Edit Record";

        SuperForm1Container.Controls.Add(window1);

        Literal hiddenInput = new Literal();
        hiddenInput.Text = "<input type=\"hidden\" id=\"OrderID\" />";
        window1.Controls.Add(hiddenInput);

        PlaceHolder superFormPlaceHolder = new PlaceHolder();
        window1.Controls.Add(superFormPlaceHolder);

        Literal div1 = new Literal();
        div1.Text = "<div class=\"super-form\" >";
        superFormPlaceHolder.Controls.Add(div1);

        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.Width = 525;
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.DefaultMode = DetailsViewMode.Insert;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "ShipName";
        field1.HeaderText = "Ship Name";
        field1.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "ShipAddress";
        field2.HeaderText = "Ship Address";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField = "ShipRegion";
        field4.HeaderText = "Ship Region";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField = "ShipPostalCode";
        field5.HeaderText = "Zip Code";
        field5.FieldSetID = "FieldSet1";

        Obout.SuperForm.DropDownListField field6 = new Obout.SuperForm.DropDownListField();
        field6.DataField = "ShipCountry";
        field6.HeaderText = "Ship Country";
        field6.FieldSetID = "FieldSet1";
        field6.DataSourceID = "SqlDataSource3";

        Obout.SuperForm.DateField field7 = new Obout.SuperForm.DateField();
        field7.DataField = "OrderDate";
        field7.HeaderText = "Order Date";
        field7.FieldSetID = "FieldSet2";
        field7.DataFormatString = "{0:MM/dd/yyyy}";
        field7.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField = "RequiredDate";
        field8.HeaderText = "Required Date";
        field8.FieldSetID = "FieldSet2";
        field8.DataFormatString = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field9 = new Obout.SuperForm.DateField();
        field9.DataField = "ShippedDate";
        field9.HeaderText = "Shipped Date";
        field9.FieldSetID = "FieldSet2";
        field9.DataFormatString = "{0:MM/dd/yyyy}";
        field9.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field10 = new Obout.SuperForm.DateField();
        field10.DataField = "ShipVia";
        field10.HeaderText = "Ship Via";
        field10.FieldSetID = "FieldSet2";

        Obout.SuperForm.CheckBoxField field11 = new Obout.SuperForm.CheckBoxField();
        field11.DataField = "Sent";
        field11.HeaderText = "Sent";
        field11.FieldSetID = "FieldSet2";

        Obout.SuperForm.TemplateField field12 = new Obout.SuperForm.TemplateField();
        field12.FieldSetID = "FieldSet4";
        field12.EditItemTemplate = new AddButtonsItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet1 = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSet1.Title = "Ship Information";

        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Title = "Order Information";
        fieldSetRow1.Items.Add(fieldSet1);
        fieldSetRow1.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID = "FieldSet4";
        fieldSet4.ColumnSpan = 2;
        fieldSet4.CssClass = "command-row";
        fieldSetRow2.Items.Add(fieldSet4);
        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);

        superFormPlaceHolder.Controls.Add(SuperForm1);
        Literal div2 = new Literal();
        div2.Text = "</div>";
        superFormPlaceHolder.Controls.Add(div2);

        window1.Controls.Add(hiddenInput);
       
    }
예제 #9
0
    protected void DataBindRowEditTemplate(Object sender, EventArgs e)
    {
        PlaceHolder oPH1 = sender as PlaceHolder;

        Obout.Grid.TemplateContainer oContainer = oPH1.NamingContainer as Obout.Grid.TemplateContainer;

        Literal hiddenInput = new Literal();

        hiddenInput.Text = "<input type=\"hidden\" id=\"OrderID\" />";

        SuperForm SuperForm1 = new SuperForm();

        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.DataSourceID             = "SqlDataSource2";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton   = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.AutoGenerateDateFields   = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.Width                    = Unit.Percentage(99);
        SuperForm1.DefaultMode              = DetailsViewMode.Insert;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField     = "OrderID";
        field1.HeaderText    = "Order ID";
        field1.ReadOnly      = true;
        field1.InsertVisible = false;
        field1.FieldSetID    = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "ShipName";
        field2.HeaderText = "Ship Name";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipAddress";
        field3.HeaderText = "Ship Address";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField  = "ShipCity";
        field4.HeaderText = "Ship City";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField  = "ShipRegion";
        field5.HeaderText = "Ship Region";
        field5.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField  = "ShipPostalCode";
        field6.HeaderText = "Zip Code";
        field6.FieldSetID = "FieldSet1";

        Obout.SuperForm.DropDownListField field7 = new Obout.SuperForm.DropDownListField();
        field7.DataField    = "ShipCountry";
        field7.HeaderText   = "Ship Country";
        field7.FieldSetID   = "FieldSet1";
        field7.DataSourceID = "SqlDataSource3";

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField             = "OrderDate";
        field8.HeaderText            = "Order Date";
        field8.FieldSetID            = "FieldSet2";
        field8.DataFormatString      = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field9 = new Obout.SuperForm.DateField();
        field9.DataField             = "RequiredDate";
        field9.HeaderText            = "Required Date";
        field9.FieldSetID            = "FieldSet2";
        field9.DataFormatString      = "{0:MM/dd/yyyy}";
        field9.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field10 = new Obout.SuperForm.DateField();
        field10.DataField             = "ShippedDate";
        field10.HeaderText            = "Shipped Date";
        field10.FieldSetID            = "FieldSet2";
        field10.DataFormatString      = "{0:MM/dd/yyyy}";
        field10.ApplyFormatInEditMode = true;

        Obout.SuperForm.BoundField field11 = new Obout.SuperForm.BoundField();
        field11.DataField  = "ShipVia";
        field11.HeaderText = "Ship Via";
        field11.FieldSetID = "FieldSet2";

        Obout.SuperForm.CheckBoxField field12 = new Obout.SuperForm.CheckBoxField();
        field12.DataField  = "Sent";
        field12.HeaderText = "Sent";
        field12.FieldSetID = "FieldSet2";

        Obout.SuperForm.MultiLineField field13 = new Obout.SuperForm.MultiLineField();
        field13.DataField         = "AdditionalInformation";
        field13.HeaderText        = "Additional Information";
        field13.FieldSetID        = "FieldSet3";
        field13.HeaderStyle.Width = 1;

        Obout.SuperForm.TemplateField field14 = new Obout.SuperForm.TemplateField();
        field14.FieldSetID       = "FieldSet4";
        field14.EditItemTemplate = new ButtonsEditItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet1    = new Obout.SuperForm.FieldSet();
        fieldSet1.ID    = "FieldSet1";
        fieldSet1.Title = "Ship Information";


        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID    = "FieldSet2";
        fieldSet2.Title = "Order Information";


        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID    = "FieldSet3";
        fieldSet3.Title = "Additional Information";

        fieldSetRow1.Items.Add(fieldSet1);
        fieldSetRow1.Items.Add(fieldSet2);
        fieldSetRow1.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet4    = new Obout.SuperForm.FieldSet();
        fieldSet4.ID         = "FieldSet4";
        fieldSet4.ColumnSpan = 3;
        fieldSet4.CssClass   = "command-row";
        fieldSetRow2.Items.Add(fieldSet4);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);

        oPH1.Controls.Add(hiddenInput);
        oPH1.Controls.Add(SuperForm1);
    }
    public void CreatetplRowEdit(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
	{
        PlaceHolder ph1 = new PlaceHolder();
        e.Container.Controls.Add(ph1);
	
        Literal inputText = new Literal();
        inputText.Text = "<input type=\"hidden\" id=\"OrderID\" />";
       
        ValidationSummary validateGroup1 = new ValidationSummary();
        validateGroup1.ID = "ValidationSummary1";
        validateGroup1.ValidationGroup = "Group1";

        ph1.Controls.Add(inputText);
        ph1.Controls.Add(validateGroup1);

        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.ValidationGroup = "Group1";
        SuperForm1.Width = Unit.Percentage(99);
        SuperForm1.DataKeyNames = new string[] { "Order ID" };
        SuperForm1.DefaultMode = DetailsViewMode.Insert;

        RequiredFieldValidator requiredFieldValidator1 = new RequiredFieldValidator();
        requiredFieldValidator1.ID = "RequiredFieldValidator1";
        requiredFieldValidator1.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator1.ErrorMessage = "Ship Name is mandatory";
        requiredFieldValidator1.Text = "*";
        requiredFieldValidator1.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator2 = new RequiredFieldValidator();
        requiredFieldValidator2.ID = "RequiredFieldValidator2";
        requiredFieldValidator2.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator2.ErrorMessage = "Ship Address is mandatory";
        requiredFieldValidator2.Text = "*";
        requiredFieldValidator2.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator3 = new RequiredFieldValidator();
        requiredFieldValidator3.ID = "RequiredFieldValidator3";
        requiredFieldValidator3.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator3.ErrorMessage = "Ship City is mandatory";
        requiredFieldValidator3.Text = "*";
        requiredFieldValidator3.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator4 = new RequiredFieldValidator();
        requiredFieldValidator4.ID = "RequiredFieldValidator4";
        requiredFieldValidator4.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator4.ErrorMessage = "Ship Country is mandatory";
        requiredFieldValidator4.Text = "*";
        requiredFieldValidator4.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator5 = new RequiredFieldValidator();
        requiredFieldValidator5.ID = "RequiredFieldValidator5";
        requiredFieldValidator5.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator5.ErrorMessage = "Order Date is mandatory";
        requiredFieldValidator5.Text = "*";
        requiredFieldValidator5.ValidationGroup = "Group1";

        RangeValidator rangeValidator1 = new RangeValidator();
        rangeValidator1.ID="RangeValidator1";
        rangeValidator1.Display = ValidatorDisplay.Dynamic; 
        rangeValidator1.MinimumValue = "1900/1/1";
        rangeValidator1.MaximumValue = "2039/12/31";
        rangeValidator1.Type = ValidationDataType.Date;
        rangeValidator1.ErrorMessage = "Order Date needs to be in this format: mm/dd/yyyy";
        rangeValidator1.Text = "*";
        rangeValidator1.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator6 = new RequiredFieldValidator();
        requiredFieldValidator6.ID = "RequiredFieldValidator6";
        requiredFieldValidator6.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator6.ErrorMessage = "Required Date is mandatory";
        requiredFieldValidator6.Text = "*";
        requiredFieldValidator6.ValidationGroup = "Group1";

        RangeValidator rangeValidator2 = new RangeValidator();
        rangeValidator2.ID="RangeValidator2";
        rangeValidator2.Display = ValidatorDisplay.Dynamic; 
        rangeValidator2.MinimumValue = "1900/1/1";
        rangeValidator2.MaximumValue = "2039/12/31";
        rangeValidator2.Type = ValidationDataType.Date;
        rangeValidator2.ErrorMessage = "Required Date needs to be in this format: mm/dd/yyyy";
        rangeValidator2.Text = "*";
        rangeValidator2.ValidationGroup = "Group1";

        RequiredFieldValidator requiredFieldValidator7 = new RequiredFieldValidator();
        requiredFieldValidator7.ID = "RequiredFieldValidator7";
        requiredFieldValidator7.Display = ValidatorDisplay.Dynamic;
        requiredFieldValidator7.ErrorMessage = "Shipped Date is mandatory";
        requiredFieldValidator7.Text = "*";
        requiredFieldValidator7.ValidationGroup = "Group1";

        RangeValidator rangeValidator3 = new RangeValidator();
        rangeValidator3.ID = "RangeValidator3";
        rangeValidator3.Display = ValidatorDisplay.Dynamic;
        rangeValidator3.MinimumValue = "1900/1/1";
        rangeValidator3.MaximumValue = "2039/12/31";
        rangeValidator3.Type = ValidationDataType.Date;
        rangeValidator3.ErrorMessage = "Shipped Date needs to be in this format: mm/dd/yyyy";
        rangeValidator3.Text = "*";
        rangeValidator3.ValidationGroup = "Group1";
        
        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "ShipName";
        field1.HeaderText = "Ship Name";
        field1.FieldSetID = "FieldSet1";
        field1.Validators.Add(requiredFieldValidator1);

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "ShipAddress";
        field2.HeaderText = "Ship Address";
        field2.FieldSetID = "FieldSet1";
        field2.Validators.Add(requiredFieldValidator2);

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";
        field3.Validators.Add(requiredFieldValidator3);
      
        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField = "ShipRegion";
        field4.HeaderText = "Ship Region";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField = "ShipPostalCode";
        field5.HeaderText = "Zip Cod";
        field5.FieldSetID = "FieldSet1";

        Obout.SuperForm.DropDownListField field6 = new Obout.SuperForm.DropDownListField();
        field6.DataField = "ShipCountry";
        field6.HeaderText = "Ship Country";
        field6.FieldSetID = "FieldSet1";
        field6.DataSourceID = "SqlDataSource3";
        field6.Validators.Add(requiredFieldValidator4);

        Obout.SuperForm.DateField field7 = new Obout.SuperForm.DateField();
        field7.DataField = "OrderDate";
        field7.HeaderText = "Order Date";
        field7.FieldSetID = "FieldSet2";
        field7.DataFormatString = "{0:MM/dd/yyyy}";
        field7.ApplyFormatInEditMode = true;
        field7.Validators.Add(requiredFieldValidator5);
        field7.Validators.Add(rangeValidator1);

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField = "RequiredDate";
        field8.HeaderText = "Required Date";
        field8.FieldSetID = "FieldSet2";
        field8.DataFormatString = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;
        field8.Validators.Add(requiredFieldValidator6);
        field8.Validators.Add(rangeValidator2);

        Obout.SuperForm.DateField field9 = new Obout.SuperForm.DateField();
        field9.DataField = "ShippedDate";
        field9.HeaderText = "Shipped Date";
        field9.FieldSetID = "FieldSet2";
        field9.DataFormatString = "{0:MM/dd/yyyy}";
        field9.ApplyFormatInEditMode = true;
        field9.Validators.Add(requiredFieldValidator7);
        field9.Validators.Add(rangeValidator3);

        Obout.SuperForm.BoundField field10 = new Obout.SuperForm.BoundField();
        field10.DataField = "ShipVia";
        field10.HeaderText = "Ship Via";
        field10.FieldSetID = "FieldSet2";

        Obout.SuperForm.CheckBoxField field11 = new Obout.SuperForm.CheckBoxField();
        field11.DataField = "Sent";
        field11.HeaderText = "Sent";
        field11.FieldSetID = "FieldSet2";

        Obout.SuperForm.MultiLineField field12 = new Obout.SuperForm.MultiLineField();
        field12.DataField = "AdditionalInformation";
        field12.HeaderText = "";
        field12.FieldSetID = "FieldSet3";
        field12.HeaderStyle.Width = 1;

        Obout.SuperForm.TemplateField field13 = new Obout.SuperForm.TemplateField();
        field13.FieldSetID = "FieldSet4";
        field13.EditItemTemplate = new btnUpdateEditItemTemplate();
        
        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet1 = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSet1.Title = "Ship Information";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Title = "Order Information";
        fieldSetRow1.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.Title = "Additional Information";
        fieldSetRow1.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID = "FieldSet4";
        fieldSet4.ColumnSpan = 3;
        fieldSet4.CssClass = "command-row";
        fieldSetRow2.Items.Add(fieldSet4);
       
        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);
       
        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);

        
        ph1.Controls.Add(SuperForm1);

    }
예제 #11
0
    void Page_load(object sender, EventArgs e)
    {
        grid1                     = new Grid();
        grid1.ID                  = "Grid1";
        grid1.DataSourceID        = "SqlDataSource1";
        grid1.Serialize           = false;
        grid1.AutoGenerateColumns = false;
        grid1.ClientSideEvents.OnBeforeClientEdit = "Grid1_ClientEdit";
        grid1.ClientSideEvents.OnBeforeClientAdd  = "Grid1_ClientAdd";
        grid1.ClientSideEvents.ExposeSender       = true;

        // creating the columns
        Column oCol1 = new Column();

        oCol1.ID         = "Column1";
        oCol1.DataField  = "OrderID";
        oCol1.ReadOnly   = true;
        oCol1.HeaderText = "ORDER ID";
        oCol1.Width      = "150";
        oCol1.Visible    = false;

        Column oCol2 = new Column();

        oCol2.ID         = "Column2";
        oCol2.DataField  = "ShipName";
        oCol2.HeaderText = "NAME";
        oCol2.Width      = "200";

        Column oCol3 = new Column();

        oCol3.ID         = "Column3";
        oCol3.DataField  = "ShipAddress";
        oCol3.Visible    = false;
        oCol3.HeaderText = "ADDRESS";
        oCol3.Width      = "125";

        Column oCol4 = new Column();

        oCol4.ID         = "Column4";
        oCol4.DataField  = "ShipCity";
        oCol4.HeaderText = "CITY";
        oCol4.Width      = "150";

        Column oCol5 = new Column();

        oCol5.ID         = "Column5";
        oCol5.DataField  = "ShipRegion";
        oCol5.Visible    = false;
        oCol5.HeaderText = "REGION";
        oCol5.Width      = "150";

        Column oCol6 = new Column();

        oCol6.ID         = "Column6";
        oCol6.DataField  = "ShipPostalCode";
        oCol6.HeaderText = "POSTAL CODE";
        oCol6.Width      = "150";

        Column oCol7 = new Column();

        oCol7.ID         = "Column7";
        oCol7.DataField  = "ShipCountry";
        oCol7.HeaderText = "COUNTRY";
        oCol7.Width      = "125";

        Column oCol8 = new Column();

        oCol8.ID                    = "Column8";
        oCol8.DataField             = "OrderDate";
        oCol8.HeaderText            = "ORDER DATE";
        oCol8.Width                 = "125";
        oCol8.DataFormatString      = "{0:MM/dd/yyyy}";
        oCol8.ApplyFormatInEditMode = true;

        Column oCol9 = new Column();

        oCol9.ID                    = "Column9";
        oCol9.DataField             = "RequiredDate";
        oCol9.Visible               = false;
        oCol9.HeaderText            = "REQUIRED DATE";
        oCol9.ApplyFormatInEditMode = true;
        oCol9.DataFormatString      = "{0:MM/dd/yyyy}";
        oCol9.Width                 = "200";

        Column oCol10 = new Column();

        oCol10.ID                    = "Column10";
        oCol10.DataField             = "ShippedDate";
        oCol10.Visible               = false;
        oCol10.ApplyFormatInEditMode = true;
        oCol10.DataFormatString      = "{0:MM/dd/yyyy}";
        oCol10.HeaderText            = "SHIPPED DATE";
        oCol10.Width                 = "200";

        Column oCol11 = new Column();

        oCol11.ID         = "Column11";
        oCol11.DataField  = "ShipVia";
        oCol11.Visible    = false;
        oCol11.HeaderText = "SHIP VIA";
        oCol11.Width      = "200";

        Column oCol12 = new Column();

        oCol12.ID         = "Column12";
        oCol12.DataField  = "Sent";
        oCol12.Visible    = false;
        oCol12.HeaderText = "SENT";
        oCol12.Width      = "175";

        Column oCol13 = new Column();

        oCol13.DataField   = "";
        oCol13.ID          = "Column12";
        oCol13.HeaderText  = "EDIT";
        oCol13.Width       = "150";
        oCol13.AllowEdit   = true;
        oCol13.AllowDelete = true;


        // add the columns to the Columns collection of the grid
        grid1.Columns.Add(oCol1);
        grid1.Columns.Add(oCol2);
        grid1.Columns.Add(oCol3);
        grid1.Columns.Add(oCol4);
        grid1.Columns.Add(oCol5);
        grid1.Columns.Add(oCol6);
        grid1.Columns.Add(oCol7);
        grid1.Columns.Add(oCol8);
        grid1.Columns.Add(oCol9);
        grid1.Columns.Add(oCol10);
        grid1.Columns.Add(oCol11);
        grid1.Columns.Add(oCol12);
        grid1.Columns.Add(oCol13);

        // add the grid to the controls collection of the PlaceHolder
        Grid1Container.Controls.Add(grid1);


        window1                   = new Window();
        window1.ID                = "Window1";
        window1.IsModal           = true;
        window1.ShowCloseButton   = true;
        window1.Status            = "";
        window1.RelativeElementID = "WindowPositionHelper";
        window1.Top               = -25;
        window1.Left              = 100;
        window1.Height            = 370;
        window1.Width             = 551;
        window1.VisibleOnLoad     = false;
        window1.StyleFolder       = "../window/wdstyles/blue";
        window1.Title             = "Add / Edit Record";

        SuperForm1Container.Controls.Add(window1);

        Literal hiddenInput = new Literal();

        hiddenInput.Text = "<input type=\"hidden\" id=\"OrderID\" />";
        window1.Controls.Add(hiddenInput);

        PlaceHolder superFormPlaceHolder = new PlaceHolder();

        window1.Controls.Add(superFormPlaceHolder);

        Literal div1 = new Literal();

        div1.Text = "<div class=\"super-form\" >";
        superFormPlaceHolder.Controls.Add(div1);

        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.Width                    = 525;
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton   = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.DefaultMode              = DetailsViewMode.Insert;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField  = "ShipName";
        field1.HeaderText = "Ship Name";
        field1.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "ShipAddress";
        field2.HeaderText = "Ship Address";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField  = "ShipRegion";
        field4.HeaderText = "Ship Region";
        field4.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField  = "ShipPostalCode";
        field5.HeaderText = "Zip Code";
        field5.FieldSetID = "FieldSet1";

        Obout.SuperForm.DropDownListField field6 = new Obout.SuperForm.DropDownListField();
        field6.DataField    = "ShipCountry";
        field6.HeaderText   = "Ship Country";
        field6.FieldSetID   = "FieldSet1";
        field6.DataSourceID = "SqlDataSource3";

        Obout.SuperForm.DateField field7 = new Obout.SuperForm.DateField();
        field7.DataField             = "OrderDate";
        field7.HeaderText            = "Order Date";
        field7.FieldSetID            = "FieldSet2";
        field7.DataFormatString      = "{0:MM/dd/yyyy}";
        field7.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field8 = new Obout.SuperForm.DateField();
        field8.DataField             = "RequiredDate";
        field8.HeaderText            = "Required Date";
        field8.FieldSetID            = "FieldSet2";
        field8.DataFormatString      = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field9 = new Obout.SuperForm.DateField();
        field9.DataField             = "ShippedDate";
        field9.HeaderText            = "Shipped Date";
        field9.FieldSetID            = "FieldSet2";
        field9.DataFormatString      = "{0:MM/dd/yyyy}";
        field9.ApplyFormatInEditMode = true;

        Obout.SuperForm.DateField field10 = new Obout.SuperForm.DateField();
        field10.DataField  = "ShipVia";
        field10.HeaderText = "Ship Via";
        field10.FieldSetID = "FieldSet2";

        Obout.SuperForm.CheckBoxField field11 = new Obout.SuperForm.CheckBoxField();
        field11.DataField  = "Sent";
        field11.HeaderText = "Sent";
        field11.FieldSetID = "FieldSet2";

        Obout.SuperForm.TemplateField field12 = new Obout.SuperForm.TemplateField();
        field12.FieldSetID       = "FieldSet4";
        field12.EditItemTemplate = new AddButtonsItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet1    = new Obout.SuperForm.FieldSet();
        fieldSet1.ID    = "FieldSet1";
        fieldSet1.Title = "Ship Information";

        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID    = "FieldSet2";
        fieldSet2.Title = "Order Information";
        fieldSetRow1.Items.Add(fieldSet1);
        fieldSetRow1.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet    fieldSet4    = new Obout.SuperForm.FieldSet();
        fieldSet4.ID         = "FieldSet4";
        fieldSet4.ColumnSpan = 2;
        fieldSet4.CssClass   = "command-row";
        fieldSetRow2.Items.Add(fieldSet4);
        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);

        superFormPlaceHolder.Controls.Add(SuperForm1);
        Literal div2 = new Literal();

        div2.Text = "</div>";
        superFormPlaceHolder.Controls.Add(div2);

        window1.Controls.Add(hiddenInput);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.Title = "Add new order";
        SuperForm1.DataSourceID = "SqlDataSource1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Insert;
        SuperForm1.Width = Unit.Pixel(480);
        SuperForm1.ItemUpdating += SuperForm1_ItemUpdating;
        SuperForm1.ItemInserting += SuperForm1_ItemInserting;

        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "OrderID";
        field1.HeaderText = "Order ID";
        field1.ReadOnly = true;
        field1.InsertVisible = false;
        field1.FieldSetID = "FieldSet1";
        field1.Visible = false;

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "ShipName";
        field2.HeaderText = "Ship Name";
        field2.FieldSetID = "FieldSet1";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "ShipCity";
        field3.HeaderText = "Ship City";
        field3.FieldSetID = "FieldSet1";


        Obout.SuperForm.DateField field4 = new Obout.SuperForm.DateField();
        field4.DataField = "OrderDate";
        field4.HeaderText = "Order Date";
        field4.DataFormatString = "{0:MM/dd/yyyy}";
        field4.ApplyFormatInEditMode = true;
        field4.FieldSetID = "FieldSet2";

        Obout.SuperForm.DropDownListField field5 = new Obout.SuperForm.DropDownListField();
        field5.DataField = "ShipCountry";
        field5.HeaderText = "Country";
        field5.DisplayField = "ShipCountry";
        field5.DataSourceID = "SqlDataSource2";
        field5.FieldSetID = "FieldSet2";

        Obout.SuperForm.TemplateField field6 = new Obout.SuperForm.TemplateField();
        field6.HeaderText = "Details";
        field6.FieldSetID = "FieldSet3";
        field6.ItemTemplate = new DetailsItemTemplate();
        field6.EditItemTemplate = new DetailsEditItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet1 = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSet1.Direction = Direction.Horizontal;
        fieldSet1.CssClass = "field-set";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Direction = Direction.Horizontal;
        fieldSet2.CssClass = "field-set";
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow3 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.Direction = Direction.Horizontal;
        fieldSet3.CssClass = "field-set";
        fieldSetRow3.Items.Add(fieldSet3);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow3);

        SuperForm1.FieldHeaderStyle.Width = Unit.Pixel(200);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);

        SuperForm1Container.Controls.Add(SuperForm1);
       
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.Width = Unit.Pixel(630);
        SuperForm1.Title = "Payment Information";
        SuperForm1.FolderStyle = "styles/black_glass";
       
        SuperForm1.DefaultMode = DetailsViewMode.Insert;
        SuperForm1.ItemInserting += SuperForm1_Inserting;
        SuperForm1.DataBound += SuperForm1_DataBound;
        
        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField = "CardNumber";
        field5.HeaderText = "Card Number";
        field5.FieldSetID = "FieldSet2";
        field5.Required = true;
        field5.ControlStyle.Width = Unit.Pixel(150);

        /*MaskedEditExtender extender1 = new MaskedEditExtender();
        extender1.ID = "MaskedEditExtender1";
        extender1.Mask = "9999-9999-9999-9999";
        extender1.MessageValidatorTip = true;
        extender1.MaskType = MaskedEditType.Number;
        field5.Masks.Add(extender1);*/

        Obout.SuperForm.DropDownListField field6 = new Obout.SuperForm.DropDownListField();
        field6.DataField = "ExpirationYear";
        field6.HeaderText = "Expiration Year";
        field6.FieldSetID = "FieldSet2";
        field6.ControlStyle.Width = 93;
        field6.Required = true;

        Obout.SuperForm.DropDownListField field7 = new Obout.SuperForm.DropDownListField();
        field7.DataField = "ExpirationMonth";
        field7.HeaderText = "ExpirationMonth";
        field7.FieldSetID = "FieldSet2";
        field7.ControlStyle.Width = 117;
        field7.Required = true;

        Obout.SuperForm.BoundField field8 = new Obout.SuperForm.BoundField();
        field8.DataField = "CIN";
        field8.HeaderText = "Security Code";
        field8.FieldSetID = "FieldSet2";
        field8.ControlStyle.Width = 83;
        field8.Required = true;
        field8.MaxLength = 3;

        /*FilteredTextBoxExtender numbers = new FilteredTextBoxExtender();
        numbers.FilterType = FilterTypes.Numbers;
        field8.Filters.Add(numbers);*/

        Obout.SuperForm.TemplateField dummyField = new Obout.SuperForm.TemplateField();
        dummyField.FieldSetID = "FieldSet3";
        dummyField.ItemTemplate = new DummyItemTemplate();
        dummyField.ItemStyle.Width = 150;

        Obout.SuperForm.CheckBoxField field4 = new Obout.SuperForm.CheckBoxField();
        field4.DataField = "SameAsBilling";
        field4.FieldSetID = "FieldSet4";
        field4.Text = "Same as the billing";
        field4.FieldsToDisable = "UserCompanyName";
        field4.FieldsToDisable = "UserCompanyName,UserFirstName,UserLastName,UserEmailAddress,UserAddress,UserCountryID,UserStateID,UserProvince,UserZip,UserVatID,UserPhone,UserFax";
        field4.ItemStyle.Width = 150;

        Obout.SuperForm.BoundField field9 = new Obout.SuperForm.BoundField();
        field9.DataField = "BillingCompanyName";
        field9.HeaderText = "Company Name";
        field9.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field10 = new Obout.SuperForm.BoundField();
        field10.DataField = "BillingFirstName";
        field10.HeaderText = "First Name";
        field10.FieldSetID = "FieldSet3";
        field10.Required = true;

        Obout.SuperForm.BoundField field11 = new Obout.SuperForm.BoundField();
        field11.DataField = "BillingLastName";
        field11.HeaderText = "Last Name";
        field11.FieldSetID = "FieldSet3";
        field11.Required = true;

        Obout.SuperForm.BoundField field12 = new Obout.SuperForm.BoundField();
        field12.DataField = "BillingEmailAddress";
        field12.HeaderText = "Email Address";
        field12.FieldSetID = "FieldSet3";
        field12.Required = true;

        Obout.SuperForm.MultiLineField field13 = new Obout.SuperForm.MultiLineField();
        field13.DataField = "BillingAddress";
        field13.HeaderText = "Address";
        field13.FieldSetID = "FieldSet3";
        field13.Required = true;

        Obout.SuperForm.DropDownListField field14 = new Obout.SuperForm.DropDownListField();
        field14.DataField = "BillingCountryID";
        field14.HeaderText = "Country";
        field14.FieldSetID = "FieldSet3";
        field14.Required = true;
        field14.DataSourceID = "CountriesDataSource";
        field14.DataValueField = "CountryID";
        field14.DataTextField = "CountryName";
        field14.Default = "219";
        field14.FieldsToEnable = "BillingStateID";
        field14.EnablingValues = "219";
        field14.FieldsToDisable = "BillingProvince";
        field14.DisablingValues = "219";

        Obout.SuperForm.DropDownListField field15 = new Obout.SuperForm.DropDownListField();
        field15.DataField = "BillingStateID";
        field15.HeaderText = "State";
        field15.FieldSetID = "FieldSet3";
        field15.Required = true;
        field15.DataSourceID = "StatesDataSource";
        field15.DataValueField = "State";
        field15.DataTextField = "State";

        Obout.SuperForm.BoundField field16 = new Obout.SuperForm.BoundField();
        field16.DataField = "BillingProvince";
        field16.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field17 = new Obout.SuperForm.BoundField();
        field17.DataField = "BillingZip";
        field17.HeaderText = "Zip Code / Postal Code";
        field17.FieldSetID = "FieldSet3";
        
        Obout.SuperForm.BoundField field18 = new Obout.SuperForm.BoundField();
        field18.DataField = "BillingVatID";
        field18.HeaderText = "VAT Exemption ID";
        field18.FieldSetID = "FieldSet3";

        Obout.SuperForm.BoundField field19 = new Obout.SuperForm.BoundField();
        field19.DataField = "BillingPhone";
        field19.HeaderText = "Phone";
        field19.FieldSetID = "FieldSet3";

        /*MaskedEditExtender extender2 = new MaskedEditExtender();
        extender2.ID = "MaskedEditExtender2";
        extender2.Mask = "(999)999-9999";
        extender2.MaskType = MaskedEditType.Number;
        field19.Masks.Add(extender2);*/

        Obout.SuperForm.BoundField field20 = new Obout.SuperForm.BoundField();
        field20.DataField = "BillingFax";
        field20.HeaderText = "Fax";
        field20.FieldSetID = "FieldSet3";

        /*MaskedEditExtender extender3 = new MaskedEditExtender();
        extender3.ID = "MaskedEditExtender3";
        extender3.Mask = "(999)999-9999";
        extender3.MaskType = MaskedEditType.Number;
        field20.Masks.Add(extender3);*/

        Obout.SuperForm.BoundField field21 = new Obout.SuperForm.BoundField();
        field21.DataField = "UserCompanyName";
        field21.HeaderText = "Company Name";
        field21.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field22 = new Obout.SuperForm.BoundField();
        field22.DataField = "UserFirstName";
        field22.HeaderText = "First Name";
        field22.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field23 = new Obout.SuperForm.BoundField();
        field23.DataField = "UserLastName";
        field23.HeaderText = "Last Name";
        field23.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field24 = new Obout.SuperForm.BoundField();
        field24.DataField = "UserEmailAddress";
        field24.HeaderText = "Email Address";
        field24.FieldSetID = "FieldSet4";

        Obout.SuperForm.MultiLineField field25 = new Obout.SuperForm.MultiLineField();
        field25.DataField = "UserAddress";
        field25.HeaderText = "Address";
        field25.FieldSetID = "FieldSet4";

        Obout.SuperForm.DropDownListField field26 = new Obout.SuperForm.DropDownListField();
        field26.DataField = "UserCountryID";
        field26.HeaderText = "Country";
        field26.FieldSetID = "FieldSet4";
        
        field26.DataSourceID = "CountriesDataSource";
        field26.DataValueField = "CountryID";
        field26.DataTextField = "CountryName";
        field26.Default = "219";
        field26.FieldsToEnable = "UserStateID";
        field26.EnablingValues = "219";
        field26.FieldsToDisable = "UserProvince";
        field26.DisablingValues = "219";

        Obout.SuperForm.DropDownListField field27 = new Obout.SuperForm.DropDownListField();
        field27.DataField = "UserStateID";
        field27.HeaderText = "State";
        field27.FieldSetID = "FieldSet4";
        
        field27.DataSourceID = "StatesDataSource";
        field27.DataValueField = "State";
        field27.DataTextField = "State";


        Obout.SuperForm.BoundField field28 = new Obout.SuperForm.BoundField();
        field28.DataField = "UserProvince";
        field28.FieldSetID = "FieldSet4";

        Obout.SuperForm.BoundField field29 = new Obout.SuperForm.BoundField();
        field29.DataField = "UserZip";
        field29.FieldSetID = "FieldSet4";
        field29.HeaderText = "Zip Code / Postal Code";

        Obout.SuperForm.BoundField field30 = new Obout.SuperForm.BoundField();
        field30.DataField = "UserVatID";
        field30.FieldSetID = "FieldSet4";
        field30.HeaderText = "VAT Exemption ID";

        Obout.SuperForm.BoundField field31 = new Obout.SuperForm.BoundField();
        field31.DataField = "UserPhone";
        field31.FieldSetID = "FieldSet4";
        field31.HeaderText = "Phone";

        /*MaskedEditExtender extender4 = new MaskedEditExtender();
        extender4.ID = "MaskedEditExtender4";
        extender4.Mask = "(999)999-9999";
        extender4.MaskType = MaskedEditType.Number;
        field31.Masks.Add(extender4);*/

        Obout.SuperForm.BoundField field32 = new Obout.SuperForm.BoundField();
        field32.DataField = "UserFax";
        field32.HeaderText = "Fax";
        field32.FieldSetID = "FieldSet4";
        
        /*MaskedEditExtender extender5 = new MaskedEditExtender();
        extender5.ID = "MaskedEditExtender5";
        extender5.Mask = "(999)999-9999";
        extender5.MaskType = MaskedEditType.Number;
        field32.Masks.Add(extender5);*/

        Obout.SuperForm.CommandField field33 = new Obout.SuperForm.CommandField();
        field33.ShowInsertButton = true;
        field33.InsertText = "Buy Now";
        field33.ShowCancelButton = false;
        field33.ButtonType = ButtonType.Button;
        field33.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        field33.FieldSetID = "CommandFields";

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Direction = Direction.Horizontal;
        fieldSet2.ColumnSpan = 2;
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow4 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.Title = "Billing Information";
        
        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID = "FieldSet4";
        fieldSet4.Title = "End-User Information";

        fieldSetRow4.Items.Add(fieldSet3);
        fieldSetRow4.Items.Add(fieldSet4);

        Obout.SuperForm.FieldSetRow fieldSetRow5 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet commandFields = new Obout.SuperForm.FieldSet();
        commandFields.ID = "CommandFields";
        commandFields.HorizontalAlign = HorizontalAlign.Center;
        commandFields.ColumnSpan = 2;
        fieldSetRow5.Items.Add(commandFields);

        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow4);
        SuperForm1.FieldSets.Add(fieldSetRow5);
        
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(dummyField);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field10);
        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);
        SuperForm1.Fields.Add(field15);
        SuperForm1.Fields.Add(field16);
        SuperForm1.Fields.Add(field17);
        SuperForm1.Fields.Add(field18);
        SuperForm1.Fields.Add(field19);
        SuperForm1.Fields.Add(field20);
        SuperForm1.Fields.Add(field21);
        SuperForm1.Fields.Add(field22);
        SuperForm1.Fields.Add(field23);
        SuperForm1.Fields.Add(field24);
        SuperForm1.Fields.Add(field25);
        SuperForm1.Fields.Add(field26);
        SuperForm1.Fields.Add(field27);
        SuperForm1.Fields.Add(field28);
        SuperForm1.Fields.Add(field29);
        SuperForm1.Fields.Add(field30);
        SuperForm1.Fields.Add(field31);
        SuperForm1.Fields.Add(field32);
        SuperForm1.Fields.Add(field33);

        SuperForm1Container.Controls.Add(SuperForm1);
        
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.FolderStyle = "styles/black_glass";
        SuperForm1.Title = "Company Survey";
        SuperForm1.AutoGenerateInsertButton = false;
        SuperForm1.AutoGenerateEditButton = false;
        SuperForm1.AutoGenerateDeleteButton = false;
        SuperForm1.Width = Unit.Pixel(480);
        SuperForm1.AllowPaging = false;
        SuperForm1.DefaultMode = DetailsViewMode.Insert;
        SuperForm1.ID = "SuperForm1";
                      
        SuperForm1.ItemInserting += SuperForm1_ItemInserting;

        Obout.SuperForm.TemplateField field1 = new Obout.SuperForm.TemplateField();
        field1.FieldSetID = "FieldSet1";
        field1.HeaderText = "1) Please describe your position with the company:";
        field1.ItemTemplate = new Field1ItemTemplate();
        field1.EditItemTemplate = new Field1EditItemTemplate();
       
        Obout.SuperForm.TemplateField field2 = new Obout.SuperForm.TemplateField();
        field2.FieldSetID = "FieldSet1";
        field2.HeaderText = "2) How long have you worked for the company?";
        field2.ItemTemplate = new Field2ItemTemplate();
        field2.EditItemTemplate = new Field2EditItemTemplate();
              
        Obout.SuperForm.TemplateField field3 = new Obout.SuperForm.TemplateField();
        field3.FieldSetID = "FieldSet2";
        field3.HeaderText = "3) Employees have a voice in major decisions regarding changes in the work environment.";
        field3.ItemTemplate = new Field3ItemTemplate();
        field3.EditItemTemplate = new Field3EditItemTemplate();

        Obout.SuperForm.TemplateField field4 = new Obout.SuperForm.TemplateField();
        field4.FieldSetID = "FieldSet2";
        field4.HeaderText = "4) I have received the in-house training I need to get my job done.";
        field4.ItemTemplate = new Field4ItemTemplate();
        field4.EditItemTemplate = new Field4EditItemTemplate();

        Obout.SuperForm.TemplateField field5 = new Obout.SuperForm.TemplateField();
        field5.FieldSetID = "FieldSet2";
        field5.HeaderText = "5) The environment of the workplace is comfortable and safe.";
        field5.ItemTemplate = new Field5ItemTemplate();
        field5.EditItemTemplate = new Field5EditItemTemplate();

        Obout.SuperForm.TemplateField field6 = new Obout.SuperForm.TemplateField();
        field6.FieldSetID = "FieldSet3";
        field6.HeaderText = "6) Employees are treated fairly and equally.";
        field6.ItemTemplate = new Field6ItemTemplate();
        field6.EditItemTemplate = new Field6EditItemTemplate();

        Obout.SuperForm.TemplateField field7 = new Obout.SuperForm.TemplateField();
        field7.FieldSetID = "FieldSet3";
        field7.HeaderText = "7) Management listens to employees.";
        field7.ItemTemplate = new Field7ItemTemplate();
        field7.EditItemTemplate = new Field7EditItemTemplate();

        Obout.SuperForm.TemplateField field8 = new Obout.SuperForm.TemplateField();
        field8.FieldSetID = "FieldSet3";
        field8.HeaderText = "8) I feel under a great deal of stress on my job.";
        field8.ItemTemplate = new Field8ItemTemplate();
        field8.EditItemTemplate = new Field8EditItemTemplate();
                   
        Obout.SuperForm.TemplateField field9 = new Obout.SuperForm.TemplateField();
        field9.FieldSetID = "FieldSet4";
        field9.HeaderText = "9) Please rate the following areas by level of importance with 1 being most important and 6 being least important.";
        field9.ItemTemplate = new Field9ItemTemplate();
        field9.EditItemTemplate = new Field9EditItemTemplate();
                             
        Obout.SuperForm.TemplateField field15 = new Obout.SuperForm.TemplateField();
        field15.FieldSetID = "FieldSet5";
        field15.ItemTemplate = new ButtonItemTemplate();

        Obout.SuperForm.FieldSetRow fieldSetRow1 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet1 = new Obout.SuperForm.FieldSet();
        fieldSet1.ID = "FieldSet1";
        fieldSet1.Direction = Direction.Horizontal;
        fieldSet1.CssClass = "field-set field-set-visible";
        fieldSetRow1.Items.Add(fieldSet1);

        Obout.SuperForm.FieldSetRow fieldSetRow2 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet2 = new Obout.SuperForm.FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.Direction = Direction.Horizontal;
        fieldSet2.CssClass = "field-set field-set-visible field-set-hidden";
        fieldSetRow2.Items.Add(fieldSet2);

        Obout.SuperForm.FieldSetRow fieldSetRow3 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet3 = new Obout.SuperForm.FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.Direction = Direction.Horizontal;
        fieldSet3.CssClass = "field-set field-set-visible field-set-hidden";
        fieldSetRow3.Items.Add(fieldSet3);

        Obout.SuperForm.FieldSetRow fieldSetRow4 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet4 = new Obout.SuperForm.FieldSet();
        fieldSet4.ID = "FieldSet4";
        fieldSet4.Direction = Direction.Horizontal;
        fieldSet4.CssClass = "field-set field-set-visible field-set-hidden";
        fieldSetRow4.Items.Add(fieldSet4);

        Obout.SuperForm.FieldSetRow fieldSetRow5 = new Obout.SuperForm.FieldSetRow();
        Obout.SuperForm.FieldSet fieldSet5 = new Obout.SuperForm.FieldSet();
        fieldSet5.ID = "FieldSet5";
        fieldSet5.Direction = Direction.Horizontal;
        fieldSet5.CssClass = "field-set field-set-buttons";
        fieldSet5.ColumnSpan = 2;
        fieldSet5.HorizontalAlign = HorizontalAlign.Center;
        fieldSetRow5.Items.Add(fieldSet5);

        SuperForm1.FieldSets.Add(fieldSetRow1);
        SuperForm1.FieldSets.Add(fieldSetRow2);
        SuperForm1.FieldSets.Add(fieldSetRow3);
        SuperForm1.FieldSets.Add(fieldSetRow4);
        SuperForm1.FieldSets.Add(fieldSetRow5);

        SuperForm1.Fields.Add(field1);
        SuperForm1.Fields.Add(field2);
        SuperForm1.Fields.Add(field3);
        SuperForm1.Fields.Add(field4);
        SuperForm1.Fields.Add(field5);
        SuperForm1.Fields.Add(field6);
        SuperForm1.Fields.Add(field7);
        SuperForm1.Fields.Add(field8);
        SuperForm1.Fields.Add(field9);
        SuperForm1.Fields.Add(field15);
        

        SuperForm1.FieldHeaderStyle.Width = Unit.Pixel(200);
        SuperForm1Container.Controls.Add(SuperForm1);
    }