Пример #1
0
        /// <devdoc>
        ///    Render the table rows.
        /// </devdoc>
        protected internal override void RenderContents(HtmlTextWriter writer)
        {
            TableRowCollection rows = Rows;
            int rowCount            = rows.Count;

            if (rowCount > 0)
            {
                if (HasRowSections)
                {
                    TableRowSection currentSection = TableRowSection.TableHeader;
                    bool            openedTag      = false;
                    foreach (TableRow row in rows)
                    {
                        if (row.TableSection < currentSection)
                        {
                            // throw if table sections aren't in order
                            throw new HttpException(SR.GetString(SR.Table_SectionsMustBeInOrder, ID));
                        }
                        if (currentSection < row.TableSection || (row.TableSection == TableRowSection.TableHeader && !openedTag))
                        {
                            if (openedTag)
                            {
                                writer.RenderEndTag();
                            }
                            currentSection = row.TableSection;
                            openedTag      = true;
                            switch (currentSection)
                            {
                            case TableRowSection.TableHeader:
                                writer.RenderBeginTag(HtmlTextWriterTag.Thead);
                                break;

                            case TableRowSection.TableBody:
                                writer.RenderBeginTag(HtmlTextWriterTag.Tbody);
                                break;

                            case TableRowSection.TableFooter:
                                writer.RenderBeginTag(HtmlTextWriterTag.Tfoot);
                                break;
                            }
                        }
                        row.RenderControl(writer);
                    }
                    writer.RenderEndTag();
                }
                else
                {
                    foreach (TableRow row in rows)
                    {
                        row.RenderControl(writer);
                    }
                }
            }
        }
Пример #2
0
 private void @__BuildControl__control2(System.Web.UI.WebControls.TableRowCollection @__ctrl)
 {
     global::System.Web.UI.WebControls.TableRow @__ctrl1;
     @__ctrl1 = this.@__BuildControl__control3();
     @__ctrl.Add(@__ctrl1);
     global::System.Web.UI.WebControls.TableRow @__ctrl2;
     @__ctrl2 = this.@__BuildControl__control7();
     @__ctrl.Add(@__ctrl2);
     global::System.Web.UI.WebControls.TableRow @__ctrl3;
     @__ctrl3 = this.@__BuildControl__control11();
     @__ctrl.Add(@__ctrl3);
 }
Пример #3
0
        protected internal override void RenderContents(HtmlTextWriter writer)
        {
            TableRowCollection rows = this.Rows;

            if (rows.Count > 0)
            {
                if (this.HasRowSections)
                {
                    TableRowSection tableHeader = TableRowSection.TableHeader;
                    bool            flag        = false;
                    foreach (TableRow row in rows)
                    {
                        if (row.TableSection < tableHeader)
                        {
                            throw new HttpException(System.Web.SR.GetString("Table_SectionsMustBeInOrder", new object[] { this.ID }));
                        }
                        if ((tableHeader < row.TableSection) || ((row.TableSection == TableRowSection.TableHeader) && !flag))
                        {
                            if (flag)
                            {
                                writer.RenderEndTag();
                            }
                            tableHeader = row.TableSection;
                            flag        = true;
                            switch (tableHeader)
                            {
                            case TableRowSection.TableHeader:
                                writer.RenderBeginTag(HtmlTextWriterTag.Thead);
                                break;

                            case TableRowSection.TableBody:
                                writer.RenderBeginTag(HtmlTextWriterTag.Tbody);
                                break;

                            case TableRowSection.TableFooter:
                                writer.RenderBeginTag(HtmlTextWriterTag.Tfoot);
                                break;
                            }
                        }
                        row.RenderControl(writer);
                    }
                    writer.RenderEndTag();
                }
                else
                {
                    foreach (TableRow row2 in rows)
                    {
                        row2.RenderControl(writer);
                    }
                }
            }
        }
Пример #4
0
        private ICollection CreateDataRowsFromFields(object dataItem, bool dataBinding, TableRowCollection rows) {
            int fieldCount = 0;
            ICollection fields = CreateFieldSet(dataItem, dataBinding);
            ArrayList rowsArray = new ArrayList();
            if (fields != null)
                fieldCount = fields.Count;

            if (fieldCount > 0) {
                DataControlRowType rowType = DataControlRowType.DataRow;
                DataControlRowState masterRowState = DataControlRowState.Normal;
                int dataRowIndex = 0;
                DetailsViewMode mode = Mode;

                if (mode == DetailsViewMode.Edit)
                    masterRowState |= DataControlRowState.Edit;
                else if (mode == DetailsViewMode.Insert)
                    masterRowState |= DataControlRowState.Insert;

                bool requiresDataBinding = false;
                foreach (DataControlField field in fields) {
                    if (field.Initialize(false, this)) {
                        requiresDataBinding = true;
                    }
                    if (DetermineRenderClientScript()) {
                        field.ValidateSupportsCallback();
                    }

                    DataControlRowState rowState = masterRowState;

                    if (dataRowIndex % 2 != 0) {
                        rowState |= DataControlRowState.Alternate;
                    }

                    rowsArray.Add(CreateRow(dataRowIndex, rowType, rowState, field, rows, null));

                    dataRowIndex++;
                }
                if (requiresDataBinding) {
                    RequiresDataBinding = true;
                }
            }
            return rowsArray;
        }
Пример #5
0
 private ICollection CreateDataRows(bool dataBinding, TableRowCollection rows, object dataItem) {
     ArrayList rowsArray = new ArrayList();
     rowsArray.AddRange(CreateDataRowsFromFields(dataItem, dataBinding, rows));
     return rowsArray;
 }
Пример #6
0
        private DataGridItem CreateItem(int itemIndex, int dataSourceIndex, ListItemType itemType, bool dataBind, object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) {
            DataGridItem item = CreateItem(itemIndex, dataSourceIndex, itemType);
            DataGridItemEventArgs e = new DataGridItemEventArgs(item);

            if (itemType != ListItemType.Pager) {
                InitializeItem(item, columns);
                if (dataBind) {
                    item.DataItem = dataItem;
                }
                OnItemCreated(e);
                rows.Add(item);

                if (dataBind) {
                    item.DataBind();
                    OnItemDataBound(e);

                    item.DataItem = null;
                }
            }
            else {
                InitializePager(item, columns.Length, pagedDataSource);
                OnItemCreated(e);
                rows.Add(item);
            }

            return item;
        }
 public ASPxSmartGridViewBottomBorderRemovalHelper(TableRowCollection rows, ASPxSmartGridViewRenderHelper helper)
 {
     Rows = rows;
     RenderHelper = helper;
 }
Пример #8
0
        private GridViewRow CreateRow(int rowIndex, int dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, bool dataBind, object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) {
            GridViewRow row = CreateRow(rowIndex, dataSourceIndex, rowType, rowState);
            GridViewRowEventArgs e = new GridViewRowEventArgs(row);

            if (rowType != DataControlRowType.Pager) {
                InitializeRow(row, fields);
            }
            else {
                InitializePager(row, fields.Length, pagedDataSource);
            }

            if (dataBind) {
                row.DataItem = dataItem;
            }

            OnRowCreated(e);
            rows.Add(row);

            if (dataBind) {
                row.DataBind();
                OnRowDataBound(e);
                row.DataItem = null;
            }

            return row;
        }
Пример #9
0
		private DataGridItem CreateItem(int itemIndex, int dsIndex, ListItemType type,
		                                bool bind, object item, DataGridColumn[] columns,
		                                TableRowCollection rows, PagedDataSource dataSrc)

		{
			DataGridItem retVal;
			DataGridItemEventArgs args;

			retVal = CreateItem(itemIndex, dsIndex, type);
			args = new DataGridItemEventArgs(retVal);

			if(type != ListItemType.Pager)
			{
				InitializeItem(retVal, columns);
				if(bind)
				{
					retVal.DataItem = item;
				}
				OnItemCreated(args);
				rows.Add(retVal);
				if(bind)
				{
					retVal.DataBind();
					OnItemDataBound(args);
					retVal.DataItem = null;
				}
			} else
			{
				InitializePager(retVal, columns.Length, dataSrc);
				OnItemCreated(args);
				rows.Add(retVal);
			}
			return retVal;
		}
Пример #10
0
 protected MxDataGridItem CreateItem(int itemIndex, int dataSourceIndex, ListItemType itemType, bool dataBind, object dataItem, MxDataGridField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)
 {
     MxDataGridItem item = this.CreateItem(itemIndex, dataSourceIndex, itemType);
     MxDataGridItemEventArgs e = new MxDataGridItemEventArgs(item);
     if (itemType != ListItemType.Pager)
     {
         this.InitializeItem(item, fields);
         if (dataBind)
         {
             item.DataItem = dataItem;
         }
         this.OnItemCreated(e);
         rows.Add(item);
         if (dataBind)
         {
             item.DataBind();
             this.OnItemDataBound(e);
             item.DataItem = null;
         }
         return item;
     }
     this.InitializePager(item, fields.Length, pagedDataSource);
     this.OnItemCreated(e);
     rows.Add(item);
     return item;
 }
Пример #11
0
        private FormViewRow CreateRow(int itemIndex, DataControlRowType rowType, DataControlRowState rowState, TableRowCollection rows, PagedDataSource pagedDataSource) {
            FormViewRow row = CreateRow(itemIndex, rowType, rowState);
            row.RenderTemplateContainer = RenderOuterTable;

            rows.Add(row);

            if (rowType != DataControlRowType.Pager) {
                InitializeRow(row);
            } else {
                InitializePager(row, pagedDataSource);
            }

            return row;
        }
Пример #12
0
        private FormViewRow CreateDataRowFromTemplates(bool dataBinding, TableRowCollection rows) {
            DataControlRowState rowState = DataControlRowState.Normal;
            int itemIndex = PageIndex;
            FormViewMode mode = Mode;

            rowState = DataControlRowState.Normal;
            if (mode == FormViewMode.Edit)
                rowState |= DataControlRowState.Edit;
            else if (mode == FormViewMode.Insert)
                rowState |= DataControlRowState.Insert;

            return CreateRow(PageIndex, DataControlRowType.DataRow, rowState, rows, null);
        }
Пример #13
0
        private FormViewRow CreateDataRow(bool dataBinding, TableRowCollection rows, object dataItem) {
            ITemplate modeTemplate = null;

            switch (Mode) {
                case FormViewMode.Edit:
                    modeTemplate = _editItemTemplate;
                    break;
                case FormViewMode.Insert:
                    if (_insertItemTemplate != null) {
                        modeTemplate = _insertItemTemplate;
                    } else {
                        modeTemplate = _editItemTemplate;
                    }
                    break;
                case FormViewMode.ReadOnly:
                    modeTemplate = _itemTemplate;
                    break;
            }

            if (modeTemplate != null) {
                return CreateDataRowFromTemplates(dataBinding, rows);
            }
            return null;
        }
        private ICollection CreateDataRowsFromFields(object dataItem, bool dataBinding, TableRowCollection rows)
        {
            int count = 0;
            ICollection is2 = this.CreateFieldSet(dataItem, dataBinding);
            ArrayList list = new ArrayList();
            if (is2 != null)
            {
                count = is2.Count;
            }
            if (count > 0)
            {
                DataControlRowType dataRow = DataControlRowType.DataRow;
                DataControlRowState normal = DataControlRowState.Normal;
                int rowIndex = 0;
                switch (this.Mode)
                {
                    case DetailsViewMode.Edit:
                        normal |= DataControlRowState.Edit;
                        break;

                    case DetailsViewMode.Insert:
                        normal |= DataControlRowState.Insert;
                        break;
                }
                bool flag = false;
                foreach (DataControlField field in is2)
                {
                    if (field.Initialize(false, this))
                    {
                        flag = true;
                    }
                    if (this.DetermineRenderClientScript())
                    {
                        field.ValidateSupportsCallback();
                    }
                    DataControlRowState rowState = normal;
                    if ((rowIndex % 2) != 0)
                    {
                        rowState |= DataControlRowState.Alternate;
                    }
                    list.Add(this.CreateRow(rowIndex, dataRow, rowState, field, rows, null));
                    rowIndex++;
                }
                if (flag)
                {
                    base.RequiresDataBinding = true;
                }
            }
            return list;
        }
 private ICollection CreateDataRows(bool dataBinding, TableRowCollection rows, object dataItem)
 {
     ArrayList list = new ArrayList();
     list.AddRange(this.CreateDataRowsFromFields(dataItem, dataBinding, rows));
     return list;
 }
Пример #16
0
        private DetailsViewRow CreateRow(int rowIndex, DataControlRowType rowType, DataControlRowState rowState, DataControlField field, TableRowCollection rows, PagedDataSource pagedDataSource) {
            DetailsViewRow row = CreateRow(rowIndex, rowType, rowState);

            rows.Add(row);
            if (rowType != DataControlRowType.Pager) {
                InitializeRow(row, field);
            } else {
                InitializePager(row, pagedDataSource);
            }

            return row;
        }
Пример #17
0
        private void InitializeRow(GridViewRow row, DataControlField[] fields, TableRowCollection newRows)
        {
            var e = new GridViewRowEventArgs(row);
            InitializeRow(row, fields);
            OnRowCreated(e);

            newRows.Add(row);

            row.DataBind();
            OnRowDataBound(e);
            row.DataItem = null;
        }
Пример #18
0
 DataGridViewRow CreateRow(int rowIndex, int dataSourceIndex, DataGridViewRowType rowType, DataGridViewRowState rowState, bool dataBind,
     object dataItem, DataControlFieldEx[] fields, TableRowCollection rows, PagedDataSourceEx pagedDataSource)
 {
     DataGridViewRow row = this.CreateRow(rowIndex, dataSourceIndex, rowType, rowState);
     DataGridViewRowEventArgs e = new DataGridViewRowEventArgs(row);
     if (rowType != DataGridViewRowType.Footer)
         this.InitializeRow(row, fields);
     else
         this.InitializePager(row, fields.Length, pagedDataSource);
     if (dataBind)
         row.DataItem = dataItem;
     this.OnRowCreated(e);
     rows.Add(row);
     if (dataBind)
     {
         row.DataBind();
         this.OnRowDataBound(e);
         row.DataItem = null;
     }
     return row;
 }