• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.DataControlField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.WebControls.DataControlField的典型用法代码示例。如果您正苦于以下问题:C# DataControlField类的具体用法?C# DataControlField怎么用?C# DataControlField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataControlField类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataControlField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateChildControls

        protected override int CreateChildControls(System.Collections.IEnumerable dataSource, bool dataBinding)
        {
            int numRows = base.CreateChildControls(dataSource, dataBinding);

            //no data rows created, create empty table if enabled
            if (numRows == 0 && ShowEmptyTable)
            {
                //create table
                Table table = new Table();
                table.ID = this.ID;

                //create a new header row
                GridViewRow row = base.CreateRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal);

                //convert the exisiting columns into an array and initialize
                DataControlField[] fields = new DataControlField[this.Columns.Count];
                this.Columns.CopyTo(fields, 0);
                this.InitializeRow(row, fields);
                table.Rows.Add(row);

                //create the empty row
                row = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal);
                TableCell cell = new TableCell();
                cell.ColumnSpan = this.Columns.Count;
                cell.Width = Unit.Percentage(100);
                cell.Controls.Add(new LiteralControl(EmptyTableRowText));
                row.Cells.Add(cell);
                table.Rows.Add(row);

                this.Controls.Add(table);
            }

            return numRows;
        }
开发者ID:thaond,项目名称:vdms-sym-project,代码行数:34,代码来源:EmptyGridView.cs


示例2: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((CheckBoxField) newField).Text = this.Text;
     this._suppressPropertyThrows = true;
     ((CheckBoxField) newField)._suppressPropertyThrows = true;
     base.CopyProperties(newField);
     this._suppressPropertyThrows = false;
     ((CheckBoxField) newField)._suppressPropertyThrows = false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:CheckBoxField.cs


示例3: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((AutoGeneratedField) newField).DataType = this.DataType;
     this._suppressPropertyThrows = true;
     ((AutoGeneratedField) newField)._suppressPropertyThrows = true;
     base.CopyProperties(newField);
     this._suppressPropertyThrows = false;
     ((AutoGeneratedField) newField)._suppressPropertyThrows = false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:AutoGeneratedField.cs


示例4: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((ButtonField) newField).CommandName = this.CommandName;
     ((ButtonField) newField).DataTextField = this.DataTextField;
     ((ButtonField) newField).DataTextFormatString = this.DataTextFormatString;
     ((ButtonField) newField).ImageUrl = this.ImageUrl;
     ((ButtonField) newField).Text = this.Text;
     base.CopyProperties(newField);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ButtonField.cs


示例5: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((TemplateField) newField).ConvertEmptyStringToNull = this.ConvertEmptyStringToNull;
     ((TemplateField) newField).AlternatingItemTemplate = this.AlternatingItemTemplate;
     ((TemplateField) newField).ItemTemplate = this.ItemTemplate;
     ((TemplateField) newField).FooterTemplate = this.FooterTemplate;
     ((TemplateField) newField).EditItemTemplate = this.EditItemTemplate;
     ((TemplateField) newField).HeaderTemplate = this.HeaderTemplate;
     ((TemplateField) newField).InsertItemTemplate = this.InsertItemTemplate;
     base.CopyProperties(newField);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:TemplateField.cs


示例6: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((HyperLinkField) newField).DataNavigateUrlFields = this.DataNavigateUrlFields;
     ((HyperLinkField) newField).DataNavigateUrlFormatString = this.DataNavigateUrlFormatString;
     ((HyperLinkField) newField).DataTextField = this.DataTextField;
     ((HyperLinkField) newField).DataTextFormatString = this.DataTextFormatString;
     ((HyperLinkField) newField).NavigateUrl = this.NavigateUrl;
     ((HyperLinkField) newField).Target = this.Target;
     ((HyperLinkField) newField).Text = this.Text;
     base.CopyProperties(newField);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:HyperLinkField.cs


示例7: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((BoundField) newField).ApplyFormatInEditMode = this.ApplyFormatInEditMode;
     ((BoundField) newField).ConvertEmptyStringToNull = this.ConvertEmptyStringToNull;
     ((BoundField) newField).DataField = this.DataField;
     ((BoundField) newField).DataFormatString = this.DataFormatString;
     ((BoundField) newField).HtmlEncode = this.HtmlEncode;
     ((BoundField) newField).HtmlEncodeFormatString = this.HtmlEncodeFormatString;
     ((BoundField) newField).NullDisplayText = this.NullDisplayText;
     ((BoundField) newField).ReadOnly = this.ReadOnly;
     base.CopyProperties(newField);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:BoundField.cs


示例8: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((ImageField) newField).AlternateText = this.AlternateText;
     ((ImageField) newField).ConvertEmptyStringToNull = this.ConvertEmptyStringToNull;
     ((ImageField) newField).DataAlternateTextField = this.DataAlternateTextField;
     ((ImageField) newField).DataAlternateTextFormatString = this.DataAlternateTextFormatString;
     ((ImageField) newField).DataImageUrlField = this.DataImageUrlField;
     ((ImageField) newField).DataImageUrlFormatString = this.DataImageUrlFormatString;
     ((ImageField) newField).NullDisplayText = this.NullDisplayText;
     ((ImageField) newField).NullImageUrl = this.NullImageUrl;
     ((ImageField) newField).ReadOnly = this.ReadOnly;
     base.CopyProperties(newField);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:ImageField.cs


示例9: CopyProperties

 protected virtual void CopyProperties(DataControlField newField)
 {
     newField.AccessibleHeaderText = this.AccessibleHeaderText;
     newField.ControlStyle.CopyFrom(this.ControlStyle);
     newField.FooterStyle.CopyFrom(this.FooterStyle);
     newField.HeaderStyle.CopyFrom(this.HeaderStyle);
     newField.ItemStyle.CopyFrom(this.ItemStyle);
     newField.FooterText = this.FooterText;
     newField.HeaderImageUrl = this.HeaderImageUrl;
     newField.HeaderText = this.HeaderText;
     newField.InsertVisible = this.InsertVisible;
     newField.ShowHeader = this.ShowHeader;
     newField.SortExpression = this.SortExpression;
     newField.Visible = this.Visible;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:DataControlField.cs


示例10: GridViewDataBind

        /// <summary>
        /// 绑定数据到GridView,当表格数据为空时显示表头
        /// </summary>
        /// <param name="gridview"></param>
        /// <param name="dt">DataTable</param>
        /// <param name="dataKeys"></param>
        public static void GridViewDataBind(GridView gridview, DataTable dt, string[] dataKeyName, string emptyText)
        {
            EmptyText = emptyText;
            //记录为空重新构造Gridview
            if (dt.Rows.Count == 0)
            {
                gridview.DataSource = dt;
                gridview.DataBind();

                if (gridview.EmptyDataTemplate != null)
                {
                    GridViewRow rowHeader = new GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal);
                    DataControlField[] tempDataControlField = new DataControlField[gridview.Columns.Count];
                    int i = 0;
                    foreach (DataControlField field in gridview.Columns)
                    {
                        tempDataControlField[i] = field;
                        i++;
                    }
                    InitializeRow(gridview, rowHeader, tempDataControlField);

                    gridview.Controls[0].Controls.Add(rowHeader);
                    GridViewRow rowBody = new GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal);

                    TableCell cellBody = new TableCell();

                    cellBody.Text = EmptyText;
                    cellBody.HorizontalAlign = HorizontalAlign.Center;
                    cellBody.ColumnSpan = i;
                    rowBody.Cells.Add(cellBody);
                    rowBody.CssClass = "";

                    gridview.Controls[0].Controls.Add(rowBody);
                }

            }
            else
            {
                //数据不为空直接绑定
                gridview.DataSource = dt;
                gridview.DataKeyNames = dataKeyName;
                gridview.DataBind();
            }

            //重新绑定取消选择
            gridview.SelectedIndex = -1;
        }
开发者ID:yangningyuan,项目名称:Jin-Shi-currency,代码行数:53,代码来源:GridViewControl.cs


示例11: OnRowCreated

        protected override void OnRowCreated(GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string sControl;
                sControl = "~/Apps/EventService/Modules/row_default.ascx";

                e.Row.Cells.Clear();

                DataControlField field = this.Columns[0];
                ((TemplateField)field).ItemTemplate = this.Page.LoadTemplate(sControl);

                DataControlField[] fields = new DataControlField[1] { field };
                this.InitializeRow(e.Row, fields);
            }
            base.OnRowCreated(e);
        }
开发者ID:0anion0,项目名称:IBN,代码行数:17,代码来源:HistoryGrid.cs


示例12: GetTemplateField

 internal static TemplateField GetTemplateField(DataControlField dataControlField, DataBoundControl dataBoundControl)
 {
     TemplateField field = new TemplateField {
         HeaderText = dataControlField.HeaderText,
         HeaderImageUrl = dataControlField.HeaderImageUrl,
         AccessibleHeaderText = dataControlField.AccessibleHeaderText,
         FooterText = dataControlField.FooterText,
         SortExpression = dataControlField.SortExpression,
         Visible = dataControlField.Visible,
         InsertVisible = dataControlField.InsertVisible,
         ShowHeader = dataControlField.ShowHeader
     };
     field.ControlStyle.CopyFrom(dataControlField.ControlStyle);
     field.FooterStyle.CopyFrom(dataControlField.FooterStyle);
     field.HeaderStyle.CopyFrom(dataControlField.HeaderStyle);
     field.ItemStyle.CopyFrom(dataControlField.ItemStyle);
     return field;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:DataControlFieldHelper.cs


示例13: CopyProperties

 protected override void CopyProperties(DataControlField newField)
 {
     ((CommandField) newField).CancelImageUrl = this.CancelImageUrl;
     ((CommandField) newField).CancelText = this.CancelText;
     ((CommandField) newField).DeleteImageUrl = this.DeleteImageUrl;
     ((CommandField) newField).DeleteText = this.DeleteText;
     ((CommandField) newField).EditImageUrl = this.EditImageUrl;
     ((CommandField) newField).EditText = this.EditText;
     ((CommandField) newField).InsertImageUrl = this.InsertImageUrl;
     ((CommandField) newField).InsertText = this.InsertText;
     ((CommandField) newField).NewImageUrl = this.NewImageUrl;
     ((CommandField) newField).NewText = this.NewText;
     ((CommandField) newField).SelectImageUrl = this.SelectImageUrl;
     ((CommandField) newField).SelectText = this.SelectText;
     ((CommandField) newField).UpdateImageUrl = this.UpdateImageUrl;
     ((CommandField) newField).UpdateText = this.UpdateText;
     ((CommandField) newField).ShowCancelButton = this.ShowCancelButton;
     ((CommandField) newField).ShowDeleteButton = this.ShowDeleteButton;
     ((CommandField) newField).ShowEditButton = this.ShowEditButton;
     ((CommandField) newField).ShowSelectButton = this.ShowSelectButton;
     ((CommandField) newField).ShowInsertButton = this.ShowInsertButton;
     base.CopyProperties(newField);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:23,代码来源:CommandField.cs


示例14: CopyProperties

 /// <summary>
 /// Overridden. Copies the properties of the current HyperLinkField object to the specified object.
 /// </summary>
 /// <param name="newField"></param>
 protected override void CopyProperties(DataControlField newField)
 {
     base.CopyProperties(newField);
     HyperLinkField field = (HyperLinkField)newField;
     field.DataNavigateUrlFields = DataNavigateUrlFields;
     field.DataNavigateUrlFormatString = DataNavigateUrlFormatString;
     field.DataTextField = DataTextField;
     field.DataTextFormatString = DataTextFormatString;
     field.NavigateUrl = NavigateUrl;
     field.Target = Target;
     field.Text = Text;
 }
开发者ID:mario-loza,项目名称:School,代码行数:16,代码来源:HyperlinkField.cs


示例15: DataControlFieldCell

 protected DataControlFieldCell(HtmlTextWriterTag tagKey, DataControlField containingField) : base(tagKey) {
     _containingField = containingField;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:3,代码来源:DataControlFieldCell.cs


示例16: CreateChildControls

		protected override int CreateChildControls (IEnumerable data, bool dataBinding)
		{
			// clear GridView
			Controls.Clear ();
			table = null;
			rows = null;

			if (data == null) {
				return 0;
			}

			PagedDataSource dataSource;

			if (dataBinding) {
				DataSourceView view = GetData ();
				dataSource = new PagedDataSource ();
				dataSource.DataSource = data;
				
				if (AllowPaging) {
					dataSource.AllowPaging = true;
					dataSource.PageSize = PageSize;
					if (view.CanPage) {
						dataSource.AllowServerPaging = true;
						if (SelectArguments.RetrieveTotalRowCount)
							dataSource.VirtualCount = SelectArguments.TotalRowCount;
					}
					if (PageIndex >= dataSource.PageCount)
						pageIndex = dataSource.PageCount - 1;
					dataSource.CurrentPageIndex = PageIndex;
				}
				
				PageCount = dataSource.PageCount;
			}
			else
			{
				dataSource = new PagedDataSource ();
				dataSource.DataSource = data;
				if (AllowPaging) {
					dataSource.AllowPaging = true;
					dataSource.PageSize = PageSize;
					dataSource.CurrentPageIndex = PageIndex;
				}
			}

			bool createPager = AllowPaging && (PageCount >= 1) && PagerSettings.Visible;

			ArrayList list = new ArrayList ();
			
			// Creates the set of fields to show

			_dataEnumerator = null;
			ICollection fieldCollection = CreateColumns (dataSource, dataBinding);
			int fieldCount = fieldCollection.Count;
			DataControlField dcf;
			DataControlField[] fields = new DataControlField [fieldCount];
			fieldCollection.CopyTo (fields, 0);
			
			for (int i = 0; i < fieldCount; i++) {
				dcf = fields [i];
				dcf.Initialize (AllowSorting, this);
				if (EnableSortingAndPagingCallbacks)
					dcf.ValidateSupportsCallback ();
			}

			bool skip_first = false;
			IEnumerator enumerator;
			if (_dataEnumerator != null) {
				// replaced when creating bound columns
				enumerator = _dataEnumerator;
				skip_first = true;
			}
			else {
				enumerator = dataSource.GetEnumerator ();
			}

			// Main table creation
			while (skip_first || enumerator.MoveNext ()) {
				skip_first = false;
				object obj = enumerator.Current;
				
				if (list.Count == 0) {
					if (createPager && (PagerSettings.Position == PagerPosition.Top || PagerSettings.Position == PagerPosition.TopAndBottom)) {
						topPagerRow = CreatePagerRow (fieldCount, dataSource);
						OnRowCreated (new GridViewRowEventArgs (topPagerRow));
						ContainedTable.Rows.Add (topPagerRow);
						if (dataBinding) {
							topPagerRow.DataBind ();
							OnRowDataBound (new GridViewRowEventArgs (topPagerRow));
						}
						if (PageCount == 1)
							topPagerRow.Visible = false;
					}

					GridViewRow headerRow = CreateRow (-1, -1, DataControlRowType.Header, DataControlRowState.Normal);
					InitializeRow (headerRow, fields);
					OnRowCreated (new GridViewRowEventArgs (headerRow));
					ContainedTable.Rows.Add (headerRow);
					if (dataBinding) {
						headerRow.DataBind ();
						OnRowDataBound (new GridViewRowEventArgs (headerRow));
//.........这里部分代码省略.........
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:101,代码来源:GridView.cs


示例17: InitializeRow

		protected virtual void InitializeRow (GridViewRow row, DataControlField[] fields)
		{
			DataControlCellType ctype;
			bool accessibleHeader = false;

			switch (row.RowType) {
			case DataControlRowType.Header:
				ctype = DataControlCellType.Header; 
				accessibleHeader = UseAccessibleHeader;
				break;
			case DataControlRowType.Footer:
				ctype = DataControlCellType.Footer;
				break;
			default:
				ctype = DataControlCellType.DataCell;
				break;
			}
			
			for (int n=0; n<fields.Length; n++) {
				DataControlField field = fields [n];
				
				DataControlFieldCell cell;
				if (((field is BoundField) && ((BoundField)field).DataField == RowHeaderColumn) || accessibleHeader)
					cell = new DataControlFieldHeaderCell (field, accessibleHeader ? TableHeaderScope.Column : TableHeaderScope.Row);
				else
					cell = new DataControlFieldCell (field);
				row.Cells.Add (cell);
				field.InitializeCell (cell, ctype, row.RowState, row.RowIndex);
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:30,代码来源:GridView.cs


示例18: GetNodeText

 public abstract string GetNodeText(DataControlField dataControlField);
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:1,代码来源:DataControlFieldDesigner.cs


示例19: GetTemplateField

 protected TemplateField GetTemplateField(DataControlField dataControlField, DataBoundControl dataBoundControl)
 {
     return DataControlFieldHelper.GetTemplateField(dataControlField, dataBoundControl);
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:4,代码来源:DataControlFieldDesigner.cs


示例20: CreateTemplateField

 public abstract TemplateField CreateTemplateField(DataControlField dataControlField, DataBoundControl dataBoundControl);
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:1,代码来源:DataControlFieldDesigner.cs



注:本文中的System.Web.UI.WebControls.DataControlField类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.DataControlFieldCell类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.CustomValidator类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap