public void Build()
        {
            this.CssClass = "GridHeadline BackgroundColor1";

            int i = 0;

            foreach (GridHeadlineItem item in this.Items)
            {
                this.Controls.Add(item);

                if (i != this.Items.Count - 1)
                {
                    GridColumnResizer resizer = new GridColumnResizer("div", this.Owner);
                    resizer.ColumnName = item.ColumnName;

                    this.Controls.Add(resizer);

                    if (Page == null)
                    {
                        resizer.Build();
                    }
                }
                else
                {
                    item.Style.Add("border-right", "none");
                }

                i++;

                if (Page == null)
                {
                    item.Build();
                }
            }

            this.Controls.Add(new LiteralControl("<div class=\"GridClear\"></div>"));
        }
Ejemplo n.º 2
0
        public void Build()
        {
            int i = 0;

            foreach (GridRowItem item in this.Items)
            {
                item.Index = i;

                this.Controls.Add(item);

                string columnName = "";


                if (this.Owner.GridHeadline.Items.Count > i)
                {
                    columnName = this.Owner.GridHeadline.Items[i].ColumnName;
                }

                item.ColumnName = columnName;

                if (i != this.Items.Count - 1)
                {
                    GridColumnResizer resizer = new GridColumnResizer("div", this.Owner);
                    resizer.ColumnName = columnName;

                    this.Controls.Add(resizer);

                    if (Page == null)
                    {
                        resizer.Build();
                    }
                }
                else
                {
                    item.Style.Add("border-right", "none");
                }

                i++;

                if (Page == null)
                {
                    item.Build();
                }
            }

            this.Attributes.Add("onclick", "SelectRow('" +
                                this.Owner.ID + "', '" +
                                this.Identity + "', " +
                                this.Owner.AutoPostBack.ToString().ToLower() + ", " +
                                "this, '" +
                                this.Owner.ClientID + "'" +
                                (this.Owner.DependingGrid != null ? ",'" + this.Owner.DependingGrid.ClientID + "'" : "") +
                                ")"
                                );

            this.Attributes.Add("ondblclick", "GridDoubleClick('" + this.Owner.ID + "');");

            if (this.Owner.SelectedItem != null &&
                this.Owner.SelectedItem.ToString() == this.Identity.ToString())
            {
                this.CssClass = "GridRow_Active";
            }
            else
            {
                this.CssClass = "GridRow";
            }

            this.Controls.Add(new LiteralControl("<div class=\"GridClear\"></div>"));
        }