Ejemplo n.º 1
0
 /// <summary>
 /// Dient zum Aufbauen eines Css- style- Attributwertes
 /// </summary>
 /// <param name="Key"></param>
 /// <param name="bld"></param>
 public override string ToString()
 {
     return(StyleBuilder.ToString(Key) + ": " + MeasuredValue.TextValue + "; ");
 }
        protected override void CreateContent(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content)
        {
            var hinweis = new HtmlCtrl.P()
            {
                InnerText   = EmptyDataText,
                CssStyleBld = EmptyDataTextStyle
            };

            content.Add(hinweis);
            content.Add(new HtmlCtrl.BR());

            var btnRemove = new Button()
            {
                Text = RemoveButtonCaption
            };

            btnRemove.Attributes.Add("style", RemoveButtonStyle.ToString());
            btnRemove.Click += new EventHandler(btnRemove_Click);
            content.Add(btnRemove);

            content.Add(new HtmlCtrl.BR());

            // Alle aktuell gültigen Filter auflisten
            var fltTab = new System.Web.UI.HtmlControls.HtmlTable();

            content.Add(fltTab);
            fltTab.Attributes.Add("style", CurrentlyActiveFiltersTabStyle.ToString());

            var header = new System.Web.UI.HtmlControls.HtmlTableRow();

            fltTab.Rows.Add(header);

            var col1Header = new System.Web.UI.HtmlControls.HtmlTableCell()
            {
                InnerText = "Filter"
            };

            header.Cells.Add(col1Header);
            var col1HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellDescription);

            col1HeaderCssBld.FontWeight = new css.FontWeightMeasure()
            {
                Value = css.FontWeightMeasure.Unit.bold
            };
            col1Header.Attributes.Add("style", col1HeaderCssBld.ToString());

            var col2Header = new System.Web.UI.HtmlControls.HtmlTableCell()
            {
                InnerText = "entfernen ja/nein"
            };

            header.Cells.Add(col2Header);
            var col2HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellAction);

            col2HeaderCssBld.FontWeight = new css.FontWeightMeasure()
            {
                Value = css.FontWeightMeasure.Unit.bold
            };
            col2Header.Attributes.Add("style", col2HeaderCssBld.ToString());



            int line = 0;

            foreach (var flt in sessVar.Filters)
            {
                var row = new System.Web.UI.HtmlControls.HtmlTableRow();
                fltTab.Rows.Add(row);

                var descr = new System.Web.UI.HtmlControls.HtmlTableCell()
                {
                    InnerText = flt.Value.Description
                };
                descr.Attributes.Add("style", CurrentlyActiveFiltersTabCellDescription.ToString());
                row.Cells.Add(descr);

                var action = new System.Web.UI.HtmlControls.HtmlTableCell();
                action.Attributes.Add("style", CurrentlyActiveFiltersTabCellAction.ToString());
                action.Controls.Add(new CheckBox()
                {
                    ID = "cbxCtrl" + line++, ClientIDMode = ClientIDMode.Static, Checked = true
                });
                row.Cells.Add(action);
            }
        }