Пример #1
0
 protected void SuperForm1_DataBound(object sender, EventArgs e)
 {
     if (SuperForm1.CurrentMode != DetailsViewMode.ReadOnly)
     {
         OboutTextBox password = SuperForm1.GetFieldControl(1) as OboutTextBox;
         password.TextMode = TextBoxMode.Password;
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        OboutInc.Calendar2.Calendar orderDateCalendar    = grid1.Templates[0].Container.FindControl("gridCal1") as OboutInc.Calendar2.Calendar;
        OboutInc.Calendar2.Calendar requiredDateCalendar = grid1.Templates[0].Container.FindControl("gridCal2") as OboutInc.Calendar2.Calendar;
        OboutInc.Calendar2.Calendar shippedDateCalendar  = grid1.Templates[0].Container.FindControl("gridCal3") as OboutInc.Calendar2.Calendar;

        OboutTextBox txtOrderDate    = grid1.Templates[0].Container.FindControl("txtOrderDate") as OboutTextBox;
        OboutTextBox txtRequiredDate = grid1.Templates[0].Container.FindControl("txtRequiredDate") as OboutTextBox;
        OboutTextBox txtShippedDate  = grid1.Templates[0].Container.FindControl("txtShippedDate") as OboutTextBox;

        orderDateCalendar.TextBoxId    = txtOrderDate.ClientID;
        requiredDateCalendar.TextBoxId = txtRequiredDate.ClientID;
        shippedDateCalendar.TextBoxId  = txtShippedDate.ClientID;
    }
    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);
    }
    void Grid2_DataBound(object sender, EventArgs e)
    {
        DetailGrid detailGrid = sender as DetailGrid;

        OboutDropDownList OrderCountry = detailGrid.Templates[0].Container.FindControl("OrderCountry") as OboutDropDownList;
        OboutTextBox      OrderAddress = detailGrid.Templates[1].Container.FindControl("OrderAddress") as OboutTextBox;

        if (OrderCountry != null && OrderAddress != null)
        {
            OrderCountry.ID = detailGrid.ID + "_OrderCountry";
            OrderAddress.ID = detailGrid.ID + "_OrderAddress";

            detailGrid.Templates[0].ControlID = OrderCountry.ID;
            detailGrid.Templates[1].ControlID = OrderAddress.ID;
        }
    }
    void grid2_DataBound(object sender, EventArgs e)
    {
        DetailGrid detailGrid = sender as DetailGrid;

        OboutTextBox      txtShipName      = detailGrid.Templates[0].Container.FindControl("txtShipName") as OboutTextBox;
        OboutTextBox      txtShipCity      = detailGrid.Templates[0].Container.FindControl("txtShipCity") as OboutTextBox;
        OboutDropDownList ddlShipCountries = detailGrid.Templates[0].Container.FindControl("ddlShipCountries") as OboutDropDownList;

        if (txtShipName != null && txtShipCity != null && ddlShipCountries != null)
        {
            txtShipName.ID      = detailGrid.ID + "_txtShipName";
            txtShipCity.ID      = detailGrid.ID + "_txtShipCity";
            ddlShipCountries.ID = detailGrid.ID + "_ddlShipCountries";

            detailGrid.Columns[2].TemplateSettings.RowEditTemplateControlId = txtShipName.ID;
            detailGrid.Columns[3].TemplateSettings.RowEditTemplateControlId = txtShipCity.ID;
            detailGrid.Columns[4].TemplateSettings.RowEditTemplateControlId = ddlShipCountries.ID;
        }
    }
    protected void SuperForm1_DataBound(object sender, EventArgs e)
    {
        if (SuperForm1.CurrentMode == DetailsViewMode.Insert)
        {
            OboutTextBox shipName = (OboutTextBox)(SuperForm1.Rows[1].Cells[1].Controls[0].Controls[0]);
            shipName.Text = "Default Name";

            OboutTextBox shipCity = (OboutTextBox)(SuperForm1.Rows[2].Cells[1].Controls[0].Controls[0]);
            shipCity.Text = "Default City";

            OboutTextBox shipCountry = (OboutTextBox)(SuperForm1.Rows[3].Cells[1].Controls[0].Controls[0]);
            shipCountry.Text = "Default Country";

            OboutTextBox orderDate = (OboutTextBox)(SuperForm1.Rows[4].Cells[1].Controls[0].Controls[0]);
            orderDate.Text = DateTime.Now.ToString("MM/dd/yyyy");

            OboutCheckBox sent = (OboutCheckBox)(SuperForm1.Rows[5].Cells[1].Controls[0]);
            sent.Checked = true;
        }
    }