Пример #1
0
    public void CreateRowEditTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder oPH1 = new PlaceHolder();

        e.Container.Controls.Add(oPH1);
        oPH1.DataBinding += new EventHandler(DataBindRowEditTemplate);
    }
    public void CreateViewEmployeeTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        Literal oLiteral = new Literal();

        e.Container.Controls.Add(oLiteral);
        oLiteral.DataBinding += new EventHandler(DataBindViewEmployeeTemplate);
    }
    public void CreateShippedDateTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder oPlaceHolder = new PlaceHolder();

        e.Container.Controls.Add(oPlaceHolder);
        oPlaceHolder.DataBinding += new EventHandler(DataBindShippedDateTemplate);
    }
Пример #4
0
    public void CreateTemplate1(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder ph1 = new PlaceHolder();

        e.Container.Controls.Add(ph1);
        ph1.DataBinding += new EventHandler(DataBindTemplate1);
    }
Пример #5
0
        //Evento para la carga del Template para la condiguracion del Grid.
        void CreateEditAddressTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
        {
            Literal oLiteral = new Literal();

            e.Container.Controls.Add(oLiteral);
            c = e.Container;
            oLiteral.DataBinding += new EventHandler(DataBindEditAddressTemplate);
        }
    public void CreateTemplate3(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        Literal oLiteral = new Literal();

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

        oLiteral.Text = "PRODUCTS";
        e.Container.Controls.Add(oLiteral);
    }
Пример #7
0
    public void CreateExpandTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        Literal expand = new Literal();

        Obout.Grid.TemplateContainer oContainer = expand.NamingContainer as Obout.Grid.TemplateContainer;
        expand.Text = "<a href=\"javascript: //\" onclick=\"showDetails(event, this);\" class=\"visible\">View Details</a><a href=\"javascript: //\" onclick=\"hideDetails(event, this);\" class=\"hidden\">Close Details</a>";

        e.Container.Controls.Add(expand);
    }
    //------------------------------------------------------------------------

    //------------------------------------------------------------------------
    public void CreateCountryFilter(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder templatePlaceHolder = new PlaceHolder();

        e.Container.Controls.Add(templatePlaceHolder);

        Obout.Interface.OboutTextBox textbox = new Obout.Interface.OboutTextBox();
        textbox.ID    = "Country";
        textbox.Width = Unit.Percentage(100);
        textbox.ClientSideEvents.OnKeyUp = "applyFilter";

        templatePlaceHolder.Controls.Add(textbox);
    }
    public void CreateEditCountryTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder oPlaceHolder = new PlaceHolder();

        e.Container.Controls.Add(oPlaceHolder);

        Obout.ComboBox.ComboBox ComboBox1 = new Obout.ComboBox.ComboBox();
        ComboBox1.ID                   = "ComboBox1";
        ComboBox1.Height               = 100;
        ComboBox1.Width                = Unit.Percentage(100);
        ComboBox1.DataSourceID         = "SqlDataSource2";
        ComboBox1.DataTextField        = "CountryName";
        ComboBox1.AppendDataBoundItems = false;
        ComboBox1.DataValueField       = "CountryName";

        oPlaceHolder.Controls.Add(ComboBox1);
    }
Пример #10
0
    public void CreateTemplate1(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder ph1 = new PlaceHolder();

        e.Container.Controls.Add(ph1);

        ComboBox combobox1 = new ComboBox();

        combobox1.ID                 = "ComboBox1";
        combobox1.Width              = Unit.Percentage(100);
        combobox1.Height             = Unit.Pixel(200);
        combobox1.DataTextField      = "CountryName";
        combobox1.DataValueField     = "CountryName";
        combobox1.EmptyText          = "Select a country ...";
        combobox1.EnableLoadOnDemand = true;
        combobox1.LoadingItems      += ComboBox1_LoadingItems;

        ph1.Controls.Add(combobox1);
    }
Пример #11
0
    protected void CreateDetailPKTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        ComboBox ddl = new ComboBox();

        ddl.ID             = "ddl_detail_pk";
        ddl.Width          = Unit.Percentage(100);
        ddl.Height         = Unit.Pixel(200);
        ddl.DataTextField  = "detail_labelfld";
        ddl.DataValueField = "detail_pk";
        ddl.EmptyText      = "Select ...";


        DataTable data = GetMasterDataTable(schema, detail_tbl, detail_pk, usestudy);

        // Looping through the items and adding them to the "Items" collection of the ComboBox
        for (int i = 0; i < data.Rows.Count; i++)
        {
            ddl.Items.Add(new ComboBoxItem(data.Rows[i][detail_labelfld].ToString(), data.Rows[i]["master_pk"].ToString()));
        }

        e.Container.Controls.Add(ddl);
    }
    //------------------------------------------------------------------------
    public void CreateEditEmployeeTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
    {
        PlaceHolder ph1 = new PlaceHolder();

        e.Container.Controls.Add(ph1);

        ComboBox comboBox = new ComboBox();

        comboBox.ID                   = "PositionsCombo";
        comboBox.Width                = Unit.Percentage(100);
        comboBox.Height               = Unit.Pixel(150);
        comboBox.AutoClose            = false;
        comboBox.EmptyText            = "Select an employee ...";
        comboBox.AppendDataBoundItems = false;
        comboBox.DataSourceID         = "sds1";
        comboBox.DataValueField       = "PositionID";
        comboBox.DataTextField        = "PositionName";

        comboBox.HeaderTemplate = new HeaderTemplate("POSITIONS");

        ComboBox EmployeesCombo = new ComboBox();

        EmployeesCombo.ID                 = "EmployeesCombo";
        EmployeesCombo.Width              = Unit.Pixel(200);
        EmployeesCombo.Height             = Unit.Pixel(150);
        EmployeesCombo.EnableLoadOnDemand = true;
        EmployeesCombo.LoadingItems      += Detail_LoadingItems;
        EmployeesCombo.EmptyText          = "Select an employee ...";
        EmployeesCombo.DataSourceID       = "sds2";
        EmployeesCombo.DataTextField      = "EmployeeName";
        EmployeesCombo.DataValueField     = "EmployeeID";

        EmployeesCombo.HeaderTemplate = new HeaderTemplate("EMPLOYEES");

        comboBox.Details.Add(EmployeesCombo);

        ph1.Controls.Add(comboBox);
    }
Пример #13
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);
    }