Beispiel #1
0
        public ParametrizedActionDateRangeControl(ActionContainerOrientation orientation)
        {
            _button = RenderHelper.CreateASPxButton();
            _button.AutoPostBack        = false;
            _button.Click              += button_Click;
            _button.EnableClientSideAPI = true;
            _button.ID = "B";
            Control editor = CreateEditorBody();

            editor.ID  = "Ed";
            label      = RenderHelper.CreateASPxLabel();
            label.ID   = "L";
            label.Wrap = DevExpress.Utils.DefaultBoolean.False;
            Table table = RenderHelper.CreateTable();

            table.CssClass = "ParametrizedActionControl";
            table.ID       = "T";
            labelCell      = new TableCell();
            TableCell editorCell = new TableCell();
            TableCell buttonCell = new TableCell();

            FillTemplateTable(orientation, table, labelCell, editorCell, buttonCell);
            labelCell.Controls.Add(label);
            labelCell.CssClass = "ControlCaption";
            editorCell.Controls.Add(editor);
            editorCell.CssClass = "Label";
            buttonCell.Controls.Add(_button);
            buttonCell.CssClass = "Editor";
            Controls.Add(table);
        }
Beispiel #2
0
        void ITemplate.InstantiateIn(Control container)
        {
            GridViewDataItemTemplateContainer gridContainer = (GridViewDataItemTemplateContainer)container;
            ASPxButton downButton = RenderHelper.CreateASPxButton();

            downButton.Text = "Down";
            downButton.ClientSideEvents.Click = String.Format(ClickEventHandlerFormat, gridContainer.Grid.ClientInstanceName, "down", gridContainer.KeyValue);
            downButton.ID = "downButton_" + container.ID;
            ASPxButton upButton = RenderHelper.CreateASPxButton();

            upButton.Text = "Up";
            upButton.ClientSideEvents.Click = String.Format(ClickEventHandlerFormat, gridContainer.Grid.ClientInstanceName, "up", gridContainer.KeyValue);
            upButton.ID = "upButton_" + container.ID;
            Table table = new Table();

            table.Rows.Add(new TableRow());
            table.Rows[0].Cells.Add(new TableCell());
            table.Rows[0].Cells.Add(new TableCell());
            table.Rows[0].Cells[0].Controls.Add(downButton);
            table.Rows[0].Cells[1].Controls.Add(upButton);
            table.Attributes["onclick"] = RenderHelper.EventCancelBubbleCommand;
            container.Controls.Add(table);
        }