Пример #1
0
    protected void DataBindRowEditTemplate(Object sender, EventArgs e)
    {
        PlaceHolder oPH1 = sender as PlaceHolder;

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

        Table oTable = new Table();

        oTable.CssClass = "rowEditTable";

        TableRow oTr = new TableRow();

        TableCell oCell1 = new TableCell();

        // For Ship Information
        Panel oPanelShipInformation = new Panel();

        oPanelShipInformation.Attributes["style"] = "width: 300px; height: 125px;";
        oPanelShipInformation.GroupingText        = "Customer Information";
        Table oTableShipInformation = new Table();

        oTableShipInformation.Rows.Add(CreateTableRowWithSpan("Customer ID:", "txtCustomerID"));
        oTableShipInformation.Rows.Add(CreateTableRowWithTextbox("Company Name:", "txtCompanyName"));
        oTableShipInformation.Rows.Add(CreateTableRowWithTextbox("Contact Name:", "txtContactName"));
        oTableShipInformation.Rows.Add(CreateTableRowWithDropdown("Country:", "ddlCountries"));
        oTableShipInformation.Rows.Add(CreateEmptyTableRow());

        oPanelShipInformation.Controls.Add(oTableShipInformation);
        oCell1.Controls.Add(oPanelShipInformation);

        oTr.Cells.Add(oCell1);
        oTable.Rows.Add(oTr);

        oPH1.Controls.Add(oTable);
    }
    protected void DataBindViewEmployeeTemplate(Object sender, EventArgs e)
    {
        Literal oLiteral = sender as Literal;

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

        oLiteral.Text = oContainer.DataItem["EmployeeName"].ToString();
    }
Пример #3
0
    protected void DataBindCreateCheckBoxEditTemplate(Object sender, EventArgs e)
    {
        Literal oLiteral = sender as Literal;

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

        oLiteral.Text = "<div onmousedown=\"editCheckBox(this, " + oContainer.PageRecordIndex + ")\" class=\"excel-checkbox\"> " + (oContainer.Value.ToString() == "True" ? "yes" : "no") + "</div><div style=\"display: none;\"><input type=\"checkbox\" onblur=\"saveCheckBoxChanges(this, " + oContainer.PageRecordIndex + ")\" /></div>";
    }
Пример #4
0
    protected void DataBindPlainEditTemplate(Object sender, EventArgs e)
    {
        Literal oLiteral = sender as Literal;

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

        oLiteral.Text = "<input type=\"text\" class=\"excel-textbox\" value=\"" + oContainer.Value.ToString() + "\" " + "onfocus=\"markAsFocused(this)\" onblur=\"markAsBlured(this, '" + grid1.Columns[oContainer.ColumnIndex].DataField + "', " + oContainer.PageRecordIndex + ")\" />";
    }
    protected void DataBindTemplate3(Object sender, EventArgs e)
    {
        Literal oLiteral = sender as Literal;

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

        oLiteral.Text = "<span class=\"tdTextLink\" id=\"grid_link3_" + oContainer.DataItem["ProductID"] + "\" onmouseover=\"attachFlyout3ToLink(" + oContainer.GridClientID.ToString() + ", this," + oContainer.PageRecordIndex.ToString() + ") \" onmouseout=\"closeFlyout3()\">More info...</span>";
    }
Пример #6
0
    protected void DataBindHeadingTemplate(Object sender, EventArgs e)
    {
        Literal oLiteral = sender as Literal;

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

        oLiteral.Text = "Orders List";
    }
    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);
    }
Пример #8
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);
    }
Пример #9
0
        //Evento para configuracion del Template del Grid.
        void DataBindEditAddressTemplate(Object sender, EventArgs e)
        {
            Literal oLiteral = sender as Literal;

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

            oLiteral.Text = "<u>" + c.Column.HeaderText + "</u> : <b><i>" + c.Value + "</i></b> (" + c.Group.PageRecordsCount + " " + (c.Group.PageRecordsCount > 1 ? "registros" : "registro") + ")";
        }
    protected void DataBindRequiredDateTemplate(Object sender, EventArgs e)
    {
        PlaceHolder oPlaceHolder = sender as PlaceHolder;

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

        Table oTable = new Table();

        oTable.CellPadding         = 0;
        oTable.CellSpacing         = 0;
        oTable.Attributes["width"] = "100%";

        TableRow oRow = new TableRow();

        TableCell oCell1 = new TableCell();
        TableCell oCell2 = new TableCell();

        oCell2.Attributes["width"] = "30";

        OboutTextBox oTextBox = new OboutTextBox();

        oTextBox.ID          = "txtRequiredDate";
        oTextBox.FolderStyle = "styles/premiere_blue/interface/OboutTextBox";
        oTextBox.Width       = Unit.Percentage(100);

        oCell1.Controls.Add(oTextBox);

        OboutInc.Calendar2.Calendar cal3 = new OboutInc.Calendar2.Calendar();
        cal3.ID                  = "Calendar3";
        cal3.StyleFolder         = "../calendar/styles/default";
        cal3.DatePickerMode      = true;
        cal3.ShowYearSelector    = true;
        cal3.DateMin             = new DateTime(1990, 1, 1);
        cal3.DateMax             = new DateTime(2015, 1, 1);
        cal3.DateFormat          = "M/d/yyyy";
        cal3.YearSelectorType    = SelectorType.HtmlList;
        cal3.TitleText           = "<span style='color:crimson'>Select year:</span> ";
        cal3.DatePickerImagePath = "../calendar/styles/icon2.gif";

        oCell2.Controls.Add(cal3);

        oRow.Cells.Add(oCell1);
        oRow.Cells.Add(oCell2);

        oTable.Rows.Add(oRow);

        oPlaceHolder.Controls.Add(oTable);
    }
Пример #11
0
    protected void DataBindTemplate1(Object sender, EventArgs e)
    {
        PlaceHolder ph1 = sender as PlaceHolder;

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

        Literal oLiteral1 = new Literal();

        oLiteral1.Text = "<a href=\"javascript: //\" onclick=\"moveUp(" + oContainer.PageRecordIndex.ToString() + "," + oContainer.RecordIndex.ToString() + ")\"><img src=\"styles/black_glass/asc.gif\" alt=\"Move up\" border=\"0\" /></a>";

        Literal oLiteral2 = new Literal();

        oLiteral2.Text = "<a href=\"javascript: //\" onclick=\"moveDown(" + oContainer.PageRecordIndex.ToString() + "," + oContainer.RecordIndex.ToString() + ")\"><img src=\"styles/black_glass/desc.gif\" alt=\"Move down\" border=\"0\" /></a>";

        ph1.Controls.Add(oLiteral1);
        ph1.Controls.Add(oLiteral2);
    }
Пример #12
0
    protected void DataBindRowEditTemplateDetail(Object sender, EventArgs e)
    {
        PlaceHolder oPH1 = sender as PlaceHolder;

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

        Literal inputHiddenCustomer = new Literal();

        inputHiddenCustomer.Text = "<input type=\"hidden\" id=\"hiddenCustomerID\" />";

        Literal inputHiddenOrder = new Literal();

        inputHiddenOrder.Text = "<input type=\"hidden\" id=\"hiddenOrderID\" />";

        Table oTable = new Table();

        oTable.CssClass = "rowEditTable";

        TableRow oTr = new TableRow();

        TableCell oCell1 = new TableCell();

        // For Ship Information
        Panel oPanelShipInformation = new Panel();

        oPanelShipInformation.Attributes["style"] = "width: 300px; height: 125px;";
        oPanelShipInformation.GroupingText        = "Ship Information";
        Table oTableShipInformation = new Table();

        oTableShipInformation.Rows.Add(CreateTableRowWithTextbox("Ship Name:", "txtShipName"));
        oTableShipInformation.Rows.Add(CreateTableRowWithTextbox("Ship City:", "txtShipCity"));
        oTableShipInformation.Rows.Add(CreateTableRowWithDropdown("Ship Country:", "ddlShipCountries"));
        oTableShipInformation.Rows.Add(CreateEmptyTableRow());

        oPanelShipInformation.Controls.Add(oTableShipInformation);
        oCell1.Controls.Add(oPanelShipInformation);

        oTr.Cells.Add(oCell1);
        oTable.Rows.Add(oTr);

        oPH1.Controls.Add(inputHiddenCustomer);
        oPH1.Controls.Add(inputHiddenOrder);
        oPH1.Controls.Add(oTable);
    }
Пример #13
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);
    }