Esempio n. 1
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            toggleAllAny = new Toggle();
            Controls.Add(toggleAllAny);
            toggleAllAny.ID = this.ID + "_toggleAllAny";
            toggleAllAny.AddCssClass("switch-mini");
            toggleAllAny.OnText  = "All";
            toggleAllAny.OffText = "Any";

            btnAddGroup = new HtmlButton();
            Controls.Add(btnAddGroup);
            btnAddGroup.ID           = this.ID + "_btnAddGroup";
            btnAddGroup.ServerClick += btnAddGroup_ServerClick;
            btnAddGroup.AddCssClass("btn btn-action");
            btnAddGroup.CausesValidation = false;

            var iAddGroup = new HtmlGenericControl("i");

            iAddGroup.AddCssClass("fa fa-list-alt");
            btnAddGroup.Controls.Add(iAddGroup);
            btnAddGroup.Controls.Add(new LiteralControl(" Add Filter Group"));

            btnAddFilter = new HtmlButton();
            Controls.Add(btnAddFilter);
            btnAddFilter.ID           = this.ID + "_btnAddFilter";
            btnAddFilter.ServerClick += btnAddFilter_ServerClick;
            btnAddFilter.AddCssClass("btn btn-action");
            btnAddFilter.CausesValidation = false;

            var iAddFilter = new HtmlGenericControl("i");

            iAddFilter.AddCssClass("fa fa-filter");
            btnAddFilter.Controls.Add(iAddFilter);
            btnAddFilter.Controls.Add(new LiteralControl(" Add Filter"));

            lbDelete = new LinkButton();
            Controls.Add(lbDelete);
            lbDelete.ID     = this.ID + "_lbDelete";
            lbDelete.Click += lbDelete_Click;
            lbDelete.AddCssClass("btn btn-xs btn-danger");
            lbDelete.CausesValidation = false;

            var iDeleteGroup = new HtmlGenericControl("i");

            iDeleteGroup.AddCssClass("fa fa-times");
            lbDelete.Controls.Add(iDeleteGroup);
        }