コード例 #1
0
        protected override void CreateChildControls()
        {
            Controls.Clear();

            ddTests.EnableViewState = false;
            ddTests.AutoPostBack    = true;
            Controls.Add(ddTests);

            btPromote.Text   = "Promote";
            btPromote.Click += new EventHandler(btPromote_Click);
            Controls.Add(btPromote);

            cbAllMembers                 = new CheckBox();
            cbAllMembers.Text            = "All Members";
            cbAllMembers.EnableViewState = false;
            cbAllMembers.AutoPostBack    = true;
            Controls.Add(cbAllMembers);

            bindDropDownLists();

            ComponentArt.Web.UI.ToolBar testToolbar = ToolBarUtility.DefaultToolBar("Test");
            ToolBarUtility.AddControlItem(testToolbar, ddTests);
            ToolBarUtility.AddControlItem(testToolbar, btPromote);
            toolbars.Add(testToolbar);

            ChildControlsCreated = true;
        }
コード例 #2
0
        protected override void CreateChildControls()
        {
            if (connectionString == string.Empty)
            {
                throw(new Exception("Empty connection string."));
            }

            ddParentSeminar = new DropDownList();
            ddParentSeminar.AutoPostBack = true;
            Controls.Add(ddParentSeminar);

            ddView = new DropDownList();
            ddView.Items.Add(new ListItem("Default"));
            ddView.Items.Add(new ListItem("Address"));
            ddView.AutoPostBack = true;
            Controls.Add(ddView);

            cbIsPaid = new CheckBox();
            if (!Page.IsPostBack)
            {
                cbIsPaid.Checked = true;                                        // Be sure to check this box by default.
            }
            cbIsPaid.AutoPostBack = true;
            Controls.Add(cbIsPaid);

            btExport        = new Button();
            btExport.Text   = "Export";
            btExport.Click += new System.EventHandler(this.btExport_Click);
            Controls.Add(btExport);

            ComponentArt.Web.UI.ToolBar searchToolBar = ToolBarUtility.DefaultToolBar("Search");
            ToolBarUtility.AddControlItem(searchToolBar, cbIsPaid);
            ToolBarUtility.AddControlItem(searchToolBar, ddParentSeminar);
            ToolBarUtility.AddControlItem(searchToolBar, ddView);
            ToolBarUtility.AddControlItem(searchToolBar, btExport);
            toolbars.Add(searchToolBar);

            ChildControlsCreated = true;

            bindDropDownLists();
        }