protected override void CreateChildControls() { base.CreateChildControls(); ddSearchMode = new DropDownList(); ddSearchMode.ID = "ddSearchMode"; if (ddSearchMode.Items.Count == 0) { ddSearchMode.Items.Add("Today"); ddSearchMode.Items.Add("This Week"); ddSearchMode.Items.Add("Last Week"); ddSearchMode.Items.Add("This Month"); ddSearchMode.Items.Add("Last Month"); ddSearchMode.Items.Add("This Year"); ddSearchMode.Items.Add("All"); } ddSearchMode.AutoPostBack = true; Controls.Add(ddSearchMode); cbSeminarFilter = new CheckBox(); cbSeminarFilter.ID = "cbSeminarFilter"; cbSeminarFilter.Text = "Seminars Only"; cbSeminarFilter.AutoPostBack = true; Controls.Add(cbSeminarFilter); toolbars[0].Items.Add(ToolBarUtility.Break()); ToolBarUtility.AddControlItem(toolbars[0], ddSearchMode); ToolBarUtility.AddControlItem(toolbars[0], cbSeminarFilter); toolbars[0].Items.Add(ToolBarUtility.Copy()); toolbars[0].Items.Add(ToolBarUtility.Paste()); ChildControlsCreated = true; }
protected override void CreateChildControls() { base.CreateChildControls(); ddSearchMode = new DropDownList(); ddSearchMode.ID = "ddSearchMode"; ddSearchMode.AutoPostBack = true; Controls.Add(ddSearchMode); ddMembers = new DropDownList(); ddMembers.ID = "ddMembers"; ddMembers.AutoPostBack = true; Controls.Add(ddMembers); ddInstructors = new DropDownList(); ddInstructors.ID = "ddInstructors"; ddInstructors.AutoPostBack = true; Controls.Add(ddInstructors); ddClassDefinitions = new DropDownList(); ddClassDefinitions.ID = "ddClassDefinitions"; ddClassDefinitions.AutoPostBack = true; Controls.Add(ddClassDefinitions); ddView = new DropDownList(); ddView.ID = "ddView"; ddView.Items.Add(new ListItem("Default", "default")); ddView.Items.Add(new ListItem("Weekly", "weekly")); ddView.Items.Add(new ListItem("Weekly Summary", "weeklysummary")); ddView.AutoPostBack = true; ddView.EnableViewState = false; Controls.Add(ddView); toolbars[0].Items.Add(ToolBarUtility.Break()); ToolBarUtility.AddControlItem(toolbars[0], ddSearchMode); ToolBarUtility.AddControlItem(toolbars[0], ddMembers); ToolBarUtility.AddControlItem(toolbars[0], ddClassDefinitions); ToolBarUtility.AddControlItem(toolbars[0], ddInstructors); toolbars[0].Items.Add(ToolBarUtility.Break()); ToolBarUtility.AddControlItem(toolbars[0], ddView); ChildControlsCreated = true; bindDropDownLists(); }
protected override void CreateToolBarControls() { base.CreateToolBarControls(); ddFormatType = new DropDownList(); ddFormatType.ID = "ddFormatType"; ddFormatType.Items.Add("Default"); ddFormatType.Items.Add("Addresses"); ddFormatType.Items.Add("Email List"); ddFormatType.Items.Add("Member IDs"); ddFormatType.AutoPostBack = true; ddFormatType.EnableViewState = false; Controls.Add(ddFormatType); ddListType = new DropDownList(); ddListType.ID = "ddListType"; ddListType.Items.Add("Active"); ddListType.Items.Add("Inactive"); ddListType.Items.Add("Instructors"); ddListType.Items.Add("Yudansha"); ddListType.Items.Add("Mudansha"); ddListType.Items.Add("Past Due"); ddListType.Items.Add("Invalid Contacts"); ddListType.Items.Add("All"); ddListType.AutoPostBack = true; ddListType.EnableViewState = false; Controls.Add(ddListType); ddSortType = new DropDownList(); ddSortType.ID = "ddSortType"; ddSortType.Items.Add(new ListItem("Last Name")); ddSortType.Items.Add(new ListItem("First Name")); ddSortType.Items.Add(new ListItem("Rank")); ddSortType.Items.Add(new ListItem("Member Type")); ddSortType.Items.Add(new ListItem("Last Signin")); ddSortType.Items.Add(new ListItem("ID")); ddSortType.AutoPostBack = true; ddSortType.EnableViewState = false; Controls.Add(ddSortType); ddCommands = new DropDownList(); ddCommands.ID = "ddCommands"; ddCommands.Items.Add(new ListItem("--- Select ---")); ddCommands.Items.Add(new ListItem("Activate", "activate")); ddCommands.Items.Add(new ListItem("Deactivate", "deactivate")); ddCommands.Items.Add(new ListItem("Grant Membership", "grantmembership")); ddCommands.Items.Add(new ListItem("--- Address ---")); ddCommands.Items.Add(new ListItem("Validate", "validateaddress")); ddCommands.Items.Add(new ListItem("Invalidate", "invalidateaddress")); ddCommands.Items.Add(new ListItem("--- Dues ---")); ddCommands.Items.Add(new ListItem("Clear Dues", "cleardues")); ddCommands.Items.Add(new ListItem("Past Due", "pastdue")); ddCommands.SelectedIndexChanged += new System.EventHandler(this.ddCommands_SelectIndexChanged); ddCommands.AutoPostBack = true; ddCommands.EnableViewState = false; Controls.Add(ddCommands); // TO ADD ITEMS TO THE TOOL BAR AFTER??? ToolBarUtility.AddControlItem(toolbars[0], ddListType); ToolBarUtility.AddControlItem(toolbars[0], ddFormatType); ToolBarUtility.AddControlItem(toolbars[0], ddSortType); ToolBarUtility.AddControlItem(toolbars[0], ddCommands); toolbars[0].Items.Add(ToolBarUtility.Break()); toolbars[0].Items.Add(ToolBarUtility.CommandItem("export", "Export", "export.gif")); bool adminMode = Page.User.IsInRole("Tessen/Administrator"); this.deleteButton.Enabled = adminMode; this.editButton.Enabled = adminMode; this.newButton.Enabled = adminMode; this.ddCommands.Enabled = adminMode; }