protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1"; 
        SuperForm1.DataSourceID = "SqlDataSource1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.AutoGenerateDateFields = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;

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

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

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

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

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

        Obout.SuperForm.MultiLineField field6 = new Obout.SuperForm.MultiLineField();
        field6.DataField = "AdditionalInformation";
        field6.HeaderText = "Details";

        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);

        if (!IsPostBack)
        {
            ConfigureWidths();
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.DataSourceID             = "SqlDataSource1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.AutoGenerateDateFields   = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;

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

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

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

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

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

        Obout.SuperForm.MultiLineField field6 = new Obout.SuperForm.MultiLineField();
        field6.DataField  = "AdditionalInformation";
        field6.HeaderText = "Details";

        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);

        if (!IsPostBack)
        {
            ConfigureWidths();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.DataSourceID             = "SqlDataSource1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.Title                    = "Order Details";
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;
        SuperForm1.AllowDataKeysInsert      = false;

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

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

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

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

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField  = "ShipCountry";
        field5.HeaderText = "Ship Country";

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField  = "ShipPostalCode";
        field6.HeaderText = "Ship Postal Code";

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

        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);

        SuperForm1Container.Controls.Add(SuperForm1);
    }
    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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;
        SuperForm1.AllowDataKeysInsert = false;
        SuperForm1.EnableModelValidation = true;

        SuperForm1.DataBound += SuperForm1_DataBound;

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

        Obout.SuperForm.BoundField field12 = new Obout.SuperForm.BoundField();
        field12.DataField = "ShipName";
        field12.HeaderText = "Ship Name";

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

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

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

        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);
        SuperForm1.Fields.Add(field15);


        SuperForm1Container.Controls.Add(SuperForm1);
        
    }
    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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;
        SuperForm1.AllowDataKeysInsert      = false;
        SuperForm1.EnableModelValidation    = true;

        SuperForm1.DataBound += SuperForm1_DataBound;

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

        Obout.SuperForm.BoundField field12 = new Obout.SuperForm.BoundField();
        field12.DataField  = "ShipName";
        field12.HeaderText = "Ship Name";

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

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

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

        SuperForm1.Fields.Add(field11);
        SuperForm1.Fields.Add(field12);
        SuperForm1.Fields.Add(field13);
        SuperForm1.Fields.Add(field14);
        SuperForm1.Fields.Add(field15);


        SuperForm1Container.Controls.Add(SuperForm1);
    }
    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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;
        
        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "OrderID";
        field1.HeaderText = "OrderID";
        field1.ReadOnly = true;
        field1.InsertVisible = false;

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

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

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

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

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

        SuperForm1Container.Controls.Add(SuperForm1);
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.DataSourceID             = "SqlDataSource1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.FolderStyle              = "styles/black_glass";
        SuperForm1.Direction                = Direction.Horizontal;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;
        SuperForm1.Width                    = Unit.Pixel(630);
        SuperForm1.FieldHeaderStyle.Width   = Unit.Pixel(110);

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

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

        Obout.SuperForm.DropDownListField field3 = new Obout.SuperForm.DropDownListField();
        field3.DataField    = "ShipCountry";
        field3.DisplayField = "ShipCountry";
        field3.HeaderText   = "Ship Country";
        field3.DataSourceID = "SqlDataSource2";

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

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

        SuperForm1Container.Controls.Add(SuperForm1);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.DataSourceID = "SqlDataSource1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.FolderStyle = "styles/black_glass";
        SuperForm1.Direction = Direction.Horizontal;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;
        SuperForm1.Width = Unit.Pixel(630);
        SuperForm1.FieldHeaderStyle.Width = Unit.Pixel(110);

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

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

        Obout.SuperForm.DropDownListField field3 = new Obout.SuperForm.DropDownListField();
        field3.DataField = "ShipCountry";
        field3.DisplayField = "ShipCountry";
        field3.HeaderText = "Ship Country";
        field3.DataSourceID = "SqlDataSource2";

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

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

        SuperForm1Container.Controls.Add(SuperForm1);  
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        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.Edit;
        SuperForm1.Width = Unit.Pixel(600);
       
        Obout.SuperForm.BoundField field1 = new Obout.SuperForm.BoundField();
        field1.DataField = "OrderID";
        field1.HeaderText = "Order ID";
        field1.ReadOnly = true;
        field1.InsertVisible = false;
        field1.FieldSetID = "FieldSet2";

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

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

        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 = "FieldSet3";

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

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

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

        Obout.SuperForm.FieldSetRow row2 = new Obout.SuperForm.FieldSetRow();
        FieldSet fieldSet2 = new FieldSet();
        fieldSet2.ID = "FieldSet2";
        fieldSet2.CssClass = "field-set";
        fieldSet2.Title = "Shipping Information";

        FieldSet fieldSet3 = new FieldSet();
        fieldSet3.ID = "FieldSet3";
        fieldSet3.CssClass = "field-set";
        fieldSet3.Title = "Timeline Information";

        row2.Items.Add(fieldSet2);
        row2.Items.Add(fieldSet3);

        SuperForm1.FieldSets.Add(row2);
    
        SuperForm1Container.Controls.Add(SuperForm1);
       
    }
    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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;
        
        RangeValidator field4Range = new RangeValidator();
        field4Range.ID = "RangeValidator1";
        field4Range.MinimumValue = "1900/1/1";
        field4Range.MaximumValue = "2039/12/31";
        field4Range.Type = ValidationDataType.Date;
        field4Range.ErrorMessage = "*";

        RangeValidator field5Range = new RangeValidator();
        field5Range.ID = "RangeValidator2";
        field5Range.MinimumValue = "1900/1/1";
        field5Range.MaximumValue = "2039/12/31";
        field5Range.Type = ValidationDataType.Date;
        field5Range.ErrorMessage = "*";

        RangeValidator field6Range = new RangeValidator();
        field6Range.ID = "RangeValidator3";
        field6Range.MinimumValue = "1900/1/1";
        field6Range.MaximumValue = "2039/12/31";
        field6Range.Type = ValidationDataType.Date;
        field6Range.ErrorMessage = "*";

        RangeValidator field7Range = new RangeValidator();
        field7Range.ID = "RangeValidator4";
        field7Range.MinimumValue = "0.00";
        field7Range.MaximumValue = "999.99";
        field7Range.Type = ValidationDataType.Currency;
        field7Range.ErrorMessage = "*";

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

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

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "ShipCountry";
        field3.HeaderText = "Ship Country";
        field3.Required = true;

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField = "OrderDate";
        field4.HeaderText = "Order Date";
        field4.Required = true;
        field4.DataFormatString = "{0:MM/dd/yyyy}";
        field4.ApplyFormatInEditMode = true;
        field4.Validators.Add(field4Range);

        Obout.SuperForm.DateField field5 = new Obout.SuperForm.DateField();
        field5.DataField = "ShippedDate";
        field5.HeaderText = "Shipped Date";
        field5.Required = true;
        field5.DataFormatString = "{0:MM/dd/yyyy}";
        field5.ApplyFormatInEditMode = true;
        field5.Validators.Add(field5Range);

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

        Obout.SuperForm.BoundField field7 = new Obout.SuperForm.BoundField();
        field7.DataField = "Freight";
        field7.HeaderText = "Freight";
        field7.Required = true;
        field7.DataFormatString = "{0:C2}";
        field7.ApplyFormatInEditMode = false;
        field7.Validators.Add(field7Range);

        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);

        SuperForm1Container.Controls.Add(SuperForm1);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.Title = "Add a new order";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.DefaultMode = DetailsViewMode.Insert;

        SuperForm1.ItemInserting += SuperForm1_Inserting;

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

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "ShipCity";
        field2.HeaderText = "Ship City";
        field2.Required = true;

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "ShipRegion";
        field3.HeaderText = "Ship Region";

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

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField = "ShipPostalCode";
        field5.HeaderText = "Ship Postal Code";

        Obout.SuperForm.DateField field6 = new Obout.SuperForm.DateField();
        field6.DataField = "OrderDate";
        field6.HeaderText = "Order Date";
        field6.Required = true;

        Obout.SuperForm.CheckBoxField field7 = new Obout.SuperForm.CheckBoxField();
        field7.DataField = "Sent";
        field7.HeaderText = "Sent";

        Obout.SuperForm.CommandField field8 = new Obout.SuperForm.CommandField();
        field8.ShowInsertButton = true;
        field8.ShowCancelButton = false;
        field8.ButtonType = ButtonType.Button;
        field8.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

        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);

         SuperForm1Container.Controls.Add(SuperForm1);
     
        if (!IsPostBack)
        {
            SuperForm1.DataBind();
        }
    }
Example #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                  = new SuperForm();
        SuperForm1.ID               = "SuperForm1";
        SuperForm1.Title            = "Add a new order";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.DefaultMode      = DetailsViewMode.Insert;

        SuperForm1.ItemInserting += SuperForm1_Inserting;

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

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "ShipCity";
        field2.HeaderText = "Ship City";
        field2.Required   = true;

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipRegion";
        field3.HeaderText = "Ship Region";

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

        Obout.SuperForm.BoundField field5 = new Obout.SuperForm.BoundField();
        field5.DataField  = "ShipPostalCode";
        field5.HeaderText = "Ship Postal Code";

        Obout.SuperForm.DateField field6 = new Obout.SuperForm.DateField();
        field6.DataField  = "OrderDate";
        field6.HeaderText = "Order Date";
        field6.Required   = true;

        Obout.SuperForm.CheckBoxField field7 = new Obout.SuperForm.CheckBoxField();
        field7.DataField  = "Sent";
        field7.HeaderText = "Sent";

        Obout.SuperForm.CommandField field8 = new Obout.SuperForm.CommandField();
        field8.ShowInsertButton          = true;
        field8.ShowCancelButton          = false;
        field8.ButtonType                = ButtonType.Button;
        field8.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

        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);

        SuperForm1Container.Controls.Add(SuperForm1);

        if (!IsPostBack)
        {
            SuperForm1.DataBind();
        }
    }
Example #13
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.DataKeyNames             = new string[] { "EmployeeID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;

        CustomValidator field4Custom = new CustomValidator();

        field4Custom.ID              = "CustomValidator1";
        field4Custom.ServerValidate += ValidateTitle;
        field4Custom.ErrorMessage    = "Title needs to be 'Mr.', 'Ms.', 'Mrs.' or 'Dr.'";
        field4Custom.Display         = ValidatorDisplay.Dynamic;

        RangeValidator field5Custom = new RangeValidator();

        field5Custom.ID           = "RangeValidator1";
        field5Custom.MinimumValue = "1900/1/1";
        field5Custom.MaximumValue = "2039/12/31";
        field5Custom.Type         = ValidationDataType.Date;
        field5Custom.ErrorMessage = "*";

        RegularExpressionValidator field6Custom = new RegularExpressionValidator();

        field6Custom.ID      = "RegularExpressionValidator1";
        field6Custom.Display = ValidatorDisplay.Dynamic;
        field6Custom.ValidationExpression = "^(\\(?\\s*\\d{3}\\s*[\\)\\-\\.]?\\s*)?[1-9]\\d{2}\\s*[\\-\\.]\\s*\\d{4}$";
        field6Custom.ErrorMessage         = "Phone numbers must have this format (###) ###-####";

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

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "FirstName";
        field2.HeaderText = "First Name";
        field2.Required   = true;

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "LastName";
        field3.HeaderText = "Last Name";
        field3.Required   = true;

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField  = "TitleOfCourtesy";
        field4.HeaderText = "Courtesy Title";
        field4.Required   = true;
        field4.Validators.Add(field4Custom);

        Obout.SuperForm.DateField field5 = new Obout.SuperForm.DateField();
        field5.DataField             = "BirthDate";
        field5.HeaderText            = "Birth Date";
        field5.Required              = true;
        field5.DataFormatString      = "{0:MM/dd/yyyy}";
        field5.ApplyFormatInEditMode = true;
        field5.Validators.Add(field5Custom);

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField  = "HomePhone";
        field6.HeaderText = "Home Phone";
        field6.Required   = true;
        field6.Validators.Add(field6Custom);

        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.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.Edit;
        SuperForm1.Width                    = Unit.Pixel(600);

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

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

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

        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            = "FieldSet3";

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

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

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

        Obout.SuperForm.FieldSetRow row2 = new Obout.SuperForm.FieldSetRow();
        FieldSet fieldSet2 = new FieldSet();

        fieldSet2.ID       = "FieldSet2";
        fieldSet2.CssClass = "field-set";
        fieldSet2.Title    = "Shipping Information";

        FieldSet fieldSet3 = new FieldSet();

        fieldSet3.ID       = "FieldSet3";
        fieldSet3.CssClass = "field-set";
        fieldSet3.Title    = "Timeline Information";

        row2.Items.Add(fieldSet2);
        row2.Items.Add(fieldSet3);

        SuperForm1.FieldSets.Add(row2);

        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.Title = "Order Details";
        SuperForm1.DataSourceID = "SqlDataSource2";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.AutoGenerateDateFields = true;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;
        SuperForm1.ItemUpdated += SuperForm1_ItemUpdated;
        SuperForm1.ItemCommand += SuperForm1_ItemCommand;

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

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

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

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

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

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

        Obout.SuperForm.DateField field7 = new Obout.SuperForm.DateField();
        field7.DataField = "ShippedDate";
        field7.HeaderText = "Shipped Date";
        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.DataFormatString = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        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);

        SuperForm1Container.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);

    }
    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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;

        RangeValidator field4Range = new RangeValidator();

        field4Range.ID           = "RangeValidator1";
        field4Range.MinimumValue = "1900/1/1";
        field4Range.MaximumValue = "2039/12/31";
        field4Range.Type         = ValidationDataType.Date;
        field4Range.ErrorMessage = "*";

        RangeValidator field5Range = new RangeValidator();

        field5Range.ID           = "RangeValidator2";
        field5Range.MinimumValue = "1900/1/1";
        field5Range.MaximumValue = "2039/12/31";
        field5Range.Type         = ValidationDataType.Date;
        field5Range.ErrorMessage = "*";

        RangeValidator field6Range = new RangeValidator();

        field6Range.ID           = "RangeValidator3";
        field6Range.MinimumValue = "1900/1/1";
        field6Range.MaximumValue = "2039/12/31";
        field6Range.Type         = ValidationDataType.Date;
        field6Range.ErrorMessage = "*";

        RangeValidator field7Range = new RangeValidator();

        field7Range.ID           = "RangeValidator4";
        field7Range.MinimumValue = "0.00";
        field7Range.MaximumValue = "999.99";
        field7Range.Type         = ValidationDataType.Currency;
        field7Range.ErrorMessage = "*";

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

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

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "ShipCountry";
        field3.HeaderText = "Ship Country";
        field3.Required   = true;

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField             = "OrderDate";
        field4.HeaderText            = "Order Date";
        field4.Required              = true;
        field4.DataFormatString      = "{0:MM/dd/yyyy}";
        field4.ApplyFormatInEditMode = true;
        field4.Validators.Add(field4Range);

        Obout.SuperForm.DateField field5 = new Obout.SuperForm.DateField();
        field5.DataField             = "ShippedDate";
        field5.HeaderText            = "Shipped Date";
        field5.Required              = true;
        field5.DataFormatString      = "{0:MM/dd/yyyy}";
        field5.ApplyFormatInEditMode = true;
        field5.Validators.Add(field5Range);

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

        Obout.SuperForm.BoundField field7 = new Obout.SuperForm.BoundField();
        field7.DataField             = "Freight";
        field7.HeaderText            = "Freight";
        field7.Required              = true;
        field7.DataFormatString      = "{0:C2}";
        field7.ApplyFormatInEditMode = false;
        field7.Validators.Add(field7Range);

        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);

        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);
       
    }
Example #20
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);
    }
Example #21
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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.AllowDataKeysInsert      = false;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Insert;
        SuperForm1.EnableModelValidation    = true;

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

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

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

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

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

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

        SuperForm1Container.Controls.Add(SuperForm1);
        SuperForm1.DataBind();

        if (SuperForm1.CurrentMode == DetailsViewMode.Edit || SuperForm1.CurrentMode == DetailsViewMode.Insert)
        {
            OboutInc.Calendar2.Calendar orderDateCalendar = (OboutInc.Calendar2.Calendar)(SuperForm1.Rows[2].Cells[1].Controls[0].Controls[1].Controls[0]);
            orderDateCalendar.CultureName = ListBox1.SelectedValue;

            OboutInc.Calendar2.Calendar shippedDateCalendar = (OboutInc.Calendar2.Calendar)(SuperForm1.Rows[3].Cells[1].Controls[0].Controls[1].Controls[0]);
            shippedDateCalendar.CultureName = ListBox1.SelectedValue;

            OboutInc.Calendar2.Calendar requiredDateCalendar = (OboutInc.Calendar2.Calendar)(SuperForm1.Rows[4].Cells[1].Controls[0].Controls[1].Controls[0]);
            requiredDateCalendar.CultureName = ListBox1.SelectedValue;
        }
    }
    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.DataKeyNames = new string[] { "EmployeeID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Edit;

        CustomValidator field4Custom = new CustomValidator();
        field4Custom.ID = "CustomValidator1";
        field4Custom.ServerValidate += ValidateTitle;
        field4Custom.ErrorMessage = "Title needs to be 'Mr.', 'Ms.', 'Mrs.' or 'Dr.'";
        field4Custom.Display = ValidatorDisplay.Dynamic;

        RangeValidator field5Custom = new RangeValidator();
        field5Custom.ID = "RangeValidator1";
        field5Custom.MinimumValue = "1900/1/1";
        field5Custom.MaximumValue = "2039/12/31";
        field5Custom.Type = ValidationDataType.Date;
        field5Custom.ErrorMessage = "*";

        RegularExpressionValidator field6Custom = new RegularExpressionValidator();
        field6Custom.ID = "RegularExpressionValidator1";
        field6Custom.Display = ValidatorDisplay.Dynamic;
        field6Custom.ValidationExpression = "^(\\(?\\s*\\d{3}\\s*[\\)\\-\\.]?\\s*)?[1-9]\\d{2}\\s*[\\-\\.]\\s*\\d{4}$";
        field6Custom.ErrorMessage = "Phone numbers must have this format (###) ###-####";

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

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "FirstName";
        field2.HeaderText = "First Name";
        field2.Required = true;

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "LastName";
        field3.HeaderText = "Last Name";
        field3.Required = true;

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField = "TitleOfCourtesy";
        field4.HeaderText = "Courtesy Title";
        field4.Required = true;
        field4.Validators.Add(field4Custom);
                
        Obout.SuperForm.DateField field5 = new Obout.SuperForm.DateField();
        field5.DataField = "BirthDate";
        field5.HeaderText = "Birth Date";
        field5.Required = true;
        field5.DataFormatString = "{0:MM/dd/yyyy}";
        field5.ApplyFormatInEditMode = true;
        field5.Validators.Add(field5Custom);

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField = "HomePhone";
        field6.HeaderText = "Home Phone";
        field6.Required = true;
        field6.Validators.Add(field6Custom);
  
        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 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);
    }
     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.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.AllowDataKeysInsert = false;
        SuperForm1.DataKeyNames = new string[] { "OrderID" };
        SuperForm1.AllowPaging = true;
        SuperForm1.DefaultMode = DetailsViewMode.Insert;
        SuperForm1.EnableModelValidation = true;

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

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

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

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

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

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

        SuperForm1Container.Controls.Add(SuperForm1);
        SuperForm1.DataBind();

        if (SuperForm1.CurrentMode == DetailsViewMode.Edit || SuperForm1.CurrentMode == DetailsViewMode.Insert)
        {
            OboutInc.Calendar2.Calendar orderDateCalendar = (OboutInc.Calendar2.Calendar)(SuperForm1.Rows[2].Cells[1].Controls[0].Controls[1].Controls[0]);
            orderDateCalendar.CultureName = ListBox1.SelectedValue;

            OboutInc.Calendar2.Calendar shippedDateCalendar = (OboutInc.Calendar2.Calendar)(SuperForm1.Rows[3].Cells[1].Controls[0].Controls[1].Controls[0]);
            shippedDateCalendar.CultureName = ListBox1.SelectedValue;

            OboutInc.Calendar2.Calendar requiredDateCalendar = (OboutInc.Calendar2.Calendar)(SuperForm1.Rows[4].Cells[1].Controls[0].Controls[1].Controls[0]);
            requiredDateCalendar.CultureName = ListBox1.SelectedValue;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1 = new SuperForm();
        SuperForm1.ID = "SuperForm1";
        SuperForm1.DataSourceID = "SqlDataSource1";
        SuperForm1.AutoGenerateRows = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames = new string[] { "EmployeeID" };
        SuperForm1.AllowPaging = true;
             
        SuperForm1.ValidationGroup = "Group1";
        SuperForm1.DefaultMode = DetailsViewMode.Insert;
        SuperForm1.ItemCommand += SuperForm1_ItemCommand;

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

        RequiredFieldValidator field2Required = new RequiredFieldValidator();
        field2Required.ID = "FirstNameValidator";
        field2Required.Display = ValidatorDisplay.None;
        field2Required.ErrorMessage = "First Name is mandatory";

        ValidatorCalloutExtender field2CalloutExtender = new ValidatorCalloutExtender();
        field2CalloutExtender.ID = "FirstNameValidatorCallout";
        field2CalloutExtender.TargetControlID = "FirstNameValidator";
        field2CalloutExtender.Width = 250;
        field2CalloutExtender.HighlightCssClass = "highlight";
        field2CalloutExtender.WarningIconImageUrl = "resources/icons/warning.gif";
        field2CalloutExtender.CloseImageUrl = "resources/icons/close.gif";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField = "FirstName";
        field2.HeaderText = "First Name";
        field2.Validators.Add(field2Required);
        field2.Validators.Add(field2CalloutExtender);

        RequiredFieldValidator field3Required = new RequiredFieldValidator();
        field3Required.ID = "LastNameValidator";
        field3Required.Display = ValidatorDisplay.None;
        field3Required.ErrorMessage = "Last Name is mandatory";
        field3Required.Text = "*";

        ValidatorCalloutExtender field3CalloutExtender = new ValidatorCalloutExtender();
        field3CalloutExtender.ID = "LastNameValidatorCallout";
        field3CalloutExtender.TargetControlID = "LastNameValidator";
        field3CalloutExtender.Width = 250;
        field3CalloutExtender.HighlightCssClass = "highlight";
        field3CalloutExtender.WarningIconImageUrl = "resources/icons/warning.gif";
        field3CalloutExtender.CloseImageUrl = "resources/icons/close.gif";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField = "LastName";
        field3.HeaderText = "Last Name";
        field3.Validators.Add(field3Required);
        field3.Validators.Add(field3CalloutExtender);

        RequiredFieldValidator field4Required = new RequiredFieldValidator();
        field4Required.ID = "TitleOfCourtesyValidator1";
        field4Required.Display = ValidatorDisplay.None;
        field4Required.ErrorMessage = "Courtesy Title is mandatory";
        field4Required.Text = "*";

        ValidatorCalloutExtender field4Callout1 = new ValidatorCalloutExtender();
        field4Callout1.ID = "TitleOfCourtesyValidatorCallout1";
        field4Callout1.TargetControlID = "TitleOfCourtesyValidator1";
        field4Callout1.Width = 250;
        field4Callout1.HighlightCssClass = "highlight";
        field4Callout1.WarningIconImageUrl = "resources/icons/warning.gif";
        field4Callout1.CloseImageUrl = "resources/icons/close.gif";

        CustomValidator field4Custom = new CustomValidator();
        field4Custom.ID = "TitleOfCourtesyValidator2";
        field4Custom.ServerValidate += ValidateTitle;
        field4Custom.Display = ValidatorDisplay.Dynamic;
        field4Custom.ErrorMessage = "Courtesy Title needs to be 'Mr.', 'Ms.', 'Mrs.' or 'Dr.'";
        field4Custom.Text = "Courtesy Title needs to be 'Mr.', 'Ms.', 'Mrs.' or 'Dr.'";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField = "TitleOfCourtesy";
        field4.HeaderText = "Courtesy Title";
        field4.Validators.Add(field4Required);
        field4.Validators.Add(field4Callout1);
        field4.Validators.Add(field4Custom);

        RequiredFieldValidator field5Required = new RequiredFieldValidator();
        field5Required.ID = "BirthDateValidator1";
        field5Required.Display = ValidatorDisplay.None;
        field5Required.ErrorMessage = "Birth Date is mandatory";
        field5Required.Text = "*";

        ValidatorCalloutExtender field5Callout1 = new ValidatorCalloutExtender();
        field5Callout1.ID = "BirthDateValidatorCallout1";
        field5Callout1.TargetControlID = "BirthDateValidator1";
        field5Callout1.Width = 250;
        field5Callout1.HighlightCssClass = "highlight";
        field5Callout1.WarningIconImageUrl = "resources/icons/warning.gif";
        field5Callout1.CloseImageUrl = "resources/icons/close.gif";

        RangeValidator field5Range = new RangeValidator();
        field5Range.ID = "BirthDateValidator2";
        field5Range.Display = ValidatorDisplay.None;
        field5Range.MinimumValue = "1900/1/1";
        field5Range.MaximumValue = "2039/12/31";
        field5Range.Type = ValidationDataType.Date;
        field5Range.ErrorMessage = "Birth Date needs to be in this format: mm/dd/yyyy";
        field5Range.Text = "*";

        ValidatorCalloutExtender field5Callout2 = new ValidatorCalloutExtender();
        field5Callout2.ID = "BirthDateValidatorCallout2";
        field5Callout2.TargetControlID = "BirthDateValidator2";
        field5Callout2.Width = 250;
        field5Callout2.HighlightCssClass = "highlight";
        field5Callout2.WarningIconImageUrl = "resources/icons/warning.gif";
        field5Callout2.CloseImageUrl = "resources/icons/close.gif";

        Obout.SuperForm.DateField field5 = new Obout.SuperForm.DateField();
        field5.DataField = "BirthDate";
        field5.HeaderText = "Birth Date";
        field5.DataFormatString = "{0:MM/dd/yyyy}";
        field5.ApplyFormatInEditMode = true;
        field5.Validators.Add(field5Required);
        field5.Validators.Add(field5Callout1);
        field5.Validators.Add(field5Range);
        field5.Validators.Add(field5Callout2);

        RequiredFieldValidator field6Required = new RequiredFieldValidator();
        field6Required.ID = "HomePhoneValidator1";
        field6Required.Display = ValidatorDisplay.None;
        field6Required.ErrorMessage = "Home Phone is mandatory";
        field6Required.Text = "*";

        ValidatorCalloutExtender field6Callout1 = new ValidatorCalloutExtender();
        field6Callout1.ID = "HomePhoneValidatorCallout1";
        field6Callout1.TargetControlID = "HomePhoneValidator1";
        field6Callout1.Width = 250;
        field6Callout1.HighlightCssClass = "highlight";
        field6Callout1.WarningIconImageUrl = "resources/icons/warning.gif";
        field6Callout1.CloseImageUrl = "resources/icons/close.gif";

        RegularExpressionValidator field6Range = new RegularExpressionValidator();
        field6Range.ID = "HomePhoneValidator2";
        field6Range.Display = ValidatorDisplay.None;
        field6Range.ValidationExpression = "^(\\(?\\s*\\d{3}\\s*[\\)\\-\\.]?\\s*)?[1-9]\\d{2}\\s*[\\-\\.]\\s*\\d{4}$";
        field6Range.ErrorMessage = "Home Phone must be in this format (###) ###-####";
        field6Range.Text = "*";

        ValidatorCalloutExtender field6Callout2 = new ValidatorCalloutExtender();
        field6Callout2.ID = "HomePhoneValidatorCallout2";
        field6Callout2.TargetControlID = "HomePhoneValidator2";
        field6Callout2.Width = 250;
        field6Callout2.HighlightCssClass = "highlight";
        field6Callout2.WarningIconImageUrl = "resources/icons/warning.gif";
        field6Callout2.CloseImageUrl = "resources/icons/close.gif";

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField = "HomePhone";
        field6.HeaderText = "Home Phone";
        field6.Validators.Add(field6Required);
        field6.Validators.Add(field6Callout1);
        field6.Validators.Add(field6Range);
        field6.Validators.Add(field6Callout2);

        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);
    }
Example #26
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 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.DataSourceID             = "SqlDataSource1";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.DataKeyNames             = new string[] { "EmployeeID" };
        SuperForm1.AllowPaging              = true;

        SuperForm1.ValidationGroup = "Group1";
        SuperForm1.DefaultMode     = DetailsViewMode.Insert;
        SuperForm1.ItemCommand    += SuperForm1_ItemCommand;

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

        RequiredFieldValidator field2Required = new RequiredFieldValidator();

        field2Required.ID           = "FirstNameValidator";
        field2Required.Display      = ValidatorDisplay.None;
        field2Required.ErrorMessage = "First Name is mandatory";

        ValidatorCalloutExtender field2CalloutExtender = new ValidatorCalloutExtender();

        field2CalloutExtender.ID = "FirstNameValidatorCallout";
        field2CalloutExtender.TargetControlID     = "FirstNameValidator";
        field2CalloutExtender.Width               = 250;
        field2CalloutExtender.HighlightCssClass   = "highlight";
        field2CalloutExtender.WarningIconImageUrl = "resources/icons/warning.gif";
        field2CalloutExtender.CloseImageUrl       = "resources/icons/close.gif";

        Obout.SuperForm.BoundField field2 = new Obout.SuperForm.BoundField();
        field2.DataField  = "FirstName";
        field2.HeaderText = "First Name";
        field2.Validators.Add(field2Required);
        field2.Validators.Add(field2CalloutExtender);

        RequiredFieldValidator field3Required = new RequiredFieldValidator();

        field3Required.ID           = "LastNameValidator";
        field3Required.Display      = ValidatorDisplay.None;
        field3Required.ErrorMessage = "Last Name is mandatory";
        field3Required.Text         = "*";

        ValidatorCalloutExtender field3CalloutExtender = new ValidatorCalloutExtender();

        field3CalloutExtender.ID = "LastNameValidatorCallout";
        field3CalloutExtender.TargetControlID     = "LastNameValidator";
        field3CalloutExtender.Width               = 250;
        field3CalloutExtender.HighlightCssClass   = "highlight";
        field3CalloutExtender.WarningIconImageUrl = "resources/icons/warning.gif";
        field3CalloutExtender.CloseImageUrl       = "resources/icons/close.gif";

        Obout.SuperForm.BoundField field3 = new Obout.SuperForm.BoundField();
        field3.DataField  = "LastName";
        field3.HeaderText = "Last Name";
        field3.Validators.Add(field3Required);
        field3.Validators.Add(field3CalloutExtender);

        RequiredFieldValidator field4Required = new RequiredFieldValidator();

        field4Required.ID           = "TitleOfCourtesyValidator1";
        field4Required.Display      = ValidatorDisplay.None;
        field4Required.ErrorMessage = "Courtesy Title is mandatory";
        field4Required.Text         = "*";

        ValidatorCalloutExtender field4Callout1 = new ValidatorCalloutExtender();

        field4Callout1.ID = "TitleOfCourtesyValidatorCallout1";
        field4Callout1.TargetControlID     = "TitleOfCourtesyValidator1";
        field4Callout1.Width               = 250;
        field4Callout1.HighlightCssClass   = "highlight";
        field4Callout1.WarningIconImageUrl = "resources/icons/warning.gif";
        field4Callout1.CloseImageUrl       = "resources/icons/close.gif";

        CustomValidator field4Custom = new CustomValidator();

        field4Custom.ID              = "TitleOfCourtesyValidator2";
        field4Custom.ServerValidate += ValidateTitle;
        field4Custom.Display         = ValidatorDisplay.Dynamic;
        field4Custom.ErrorMessage    = "Courtesy Title needs to be 'Mr.', 'Ms.', 'Mrs.' or 'Dr.'";
        field4Custom.Text            = "Courtesy Title needs to be 'Mr.', 'Ms.', 'Mrs.' or 'Dr.'";

        Obout.SuperForm.BoundField field4 = new Obout.SuperForm.BoundField();
        field4.DataField  = "TitleOfCourtesy";
        field4.HeaderText = "Courtesy Title";
        field4.Validators.Add(field4Required);
        field4.Validators.Add(field4Callout1);
        field4.Validators.Add(field4Custom);

        RequiredFieldValidator field5Required = new RequiredFieldValidator();

        field5Required.ID           = "BirthDateValidator1";
        field5Required.Display      = ValidatorDisplay.None;
        field5Required.ErrorMessage = "Birth Date is mandatory";
        field5Required.Text         = "*";

        ValidatorCalloutExtender field5Callout1 = new ValidatorCalloutExtender();

        field5Callout1.ID = "BirthDateValidatorCallout1";
        field5Callout1.TargetControlID     = "BirthDateValidator1";
        field5Callout1.Width               = 250;
        field5Callout1.HighlightCssClass   = "highlight";
        field5Callout1.WarningIconImageUrl = "resources/icons/warning.gif";
        field5Callout1.CloseImageUrl       = "resources/icons/close.gif";

        RangeValidator field5Range = new RangeValidator();

        field5Range.ID           = "BirthDateValidator2";
        field5Range.Display      = ValidatorDisplay.None;
        field5Range.MinimumValue = "1900/1/1";
        field5Range.MaximumValue = "2039/12/31";
        field5Range.Type         = ValidationDataType.Date;
        field5Range.ErrorMessage = "Birth Date needs to be in this format: mm/dd/yyyy";
        field5Range.Text         = "*";

        ValidatorCalloutExtender field5Callout2 = new ValidatorCalloutExtender();

        field5Callout2.ID = "BirthDateValidatorCallout2";
        field5Callout2.TargetControlID     = "BirthDateValidator2";
        field5Callout2.Width               = 250;
        field5Callout2.HighlightCssClass   = "highlight";
        field5Callout2.WarningIconImageUrl = "resources/icons/warning.gif";
        field5Callout2.CloseImageUrl       = "resources/icons/close.gif";

        Obout.SuperForm.DateField field5 = new Obout.SuperForm.DateField();
        field5.DataField             = "BirthDate";
        field5.HeaderText            = "Birth Date";
        field5.DataFormatString      = "{0:MM/dd/yyyy}";
        field5.ApplyFormatInEditMode = true;
        field5.Validators.Add(field5Required);
        field5.Validators.Add(field5Callout1);
        field5.Validators.Add(field5Range);
        field5.Validators.Add(field5Callout2);

        RequiredFieldValidator field6Required = new RequiredFieldValidator();

        field6Required.ID           = "HomePhoneValidator1";
        field6Required.Display      = ValidatorDisplay.None;
        field6Required.ErrorMessage = "Home Phone is mandatory";
        field6Required.Text         = "*";

        ValidatorCalloutExtender field6Callout1 = new ValidatorCalloutExtender();

        field6Callout1.ID = "HomePhoneValidatorCallout1";
        field6Callout1.TargetControlID     = "HomePhoneValidator1";
        field6Callout1.Width               = 250;
        field6Callout1.HighlightCssClass   = "highlight";
        field6Callout1.WarningIconImageUrl = "resources/icons/warning.gif";
        field6Callout1.CloseImageUrl       = "resources/icons/close.gif";

        RegularExpressionValidator field6Range = new RegularExpressionValidator();

        field6Range.ID      = "HomePhoneValidator2";
        field6Range.Display = ValidatorDisplay.None;
        field6Range.ValidationExpression = "^(\\(?\\s*\\d{3}\\s*[\\)\\-\\.]?\\s*)?[1-9]\\d{2}\\s*[\\-\\.]\\s*\\d{4}$";
        field6Range.ErrorMessage         = "Home Phone must be in this format (###) ###-####";
        field6Range.Text = "*";

        ValidatorCalloutExtender field6Callout2 = new ValidatorCalloutExtender();

        field6Callout2.ID = "HomePhoneValidatorCallout2";
        field6Callout2.TargetControlID     = "HomePhoneValidator2";
        field6Callout2.Width               = 250;
        field6Callout2.HighlightCssClass   = "highlight";
        field6Callout2.WarningIconImageUrl = "resources/icons/warning.gif";
        field6Callout2.CloseImageUrl       = "resources/icons/close.gif";

        Obout.SuperForm.BoundField field6 = new Obout.SuperForm.BoundField();
        field6.DataField  = "HomePhone";
        field6.HeaderText = "Home Phone";
        field6.Validators.Add(field6Required);
        field6.Validators.Add(field6Callout1);
        field6.Validators.Add(field6Range);
        field6.Validators.Add(field6Callout2);

        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);
    }
Example #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SuperForm1                          = new SuperForm();
        SuperForm1.ID                       = "SuperForm1";
        SuperForm1.Title                    = "Edit Order";
        SuperForm1.DataSourceID             = "SqlDataSource2";
        SuperForm1.AutoGenerateRows         = false;
        SuperForm1.AutoGenerateInsertButton = true;
        SuperForm1.AutoGenerateEditButton   = true;
        SuperForm1.AutoGenerateDeleteButton = true;
        SuperForm1.AutoGenerateDateFields   = true;
        SuperForm1.DataKeyNames             = new string[] { "OrderID" };
        SuperForm1.AllowPaging              = true;
        SuperForm1.DefaultMode              = DetailsViewMode.Edit;
        SuperForm1.ItemUpdated             += SuperForm1_ItemUpdated;
        SuperForm1.ItemCommand             += SuperForm1_ItemCommand;

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

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

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

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

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

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

        Obout.SuperForm.DateField field7 = new Obout.SuperForm.DateField();
        field7.DataField             = "ShippedDate";
        field7.HeaderText            = "Shipped Date";
        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.DataFormatString      = "{0:MM/dd/yyyy}";
        field8.ApplyFormatInEditMode = true;

        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);

        SuperForm1Container.Controls.Add(SuperForm1);

        if (!IsPostBack)
        {
            SqlDataSource2.SelectParameters[0].DefaultValue = Request.QueryString["OrderID"];
        }
    }
    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);
       
    }
Example #31
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);
    }
Example #32
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);
    }