System.Web.UI.WebControls.FormView.PrepareControlHierarchy C# (CSharp) Method

PrepareControlHierarchy() protected method

protected PrepareControlHierarchy ( ) : void
return void
		protected internal virtual void PrepareControlHierarchy ()
		{
			if (table == null)
				return;

			table.Caption = Caption;
			table.CaptionAlign = CaptionAlign;

			foreach (FormViewRow row in table.Rows) {
				switch (row.RowType) {
				case DataControlRowType.Header:
					if (headerStyle != null && !headerStyle.IsEmpty)
						row.ControlStyle.CopyFrom (headerStyle);
					break;
				case DataControlRowType.Footer:
					if (footerStyle != null && !footerStyle.IsEmpty)
						row.ControlStyle.CopyFrom (footerStyle);
					break;
				case DataControlRowType.Pager:
					if (pagerStyle != null && !pagerStyle.IsEmpty)
						row.ControlStyle.CopyFrom (pagerStyle);
					break;
				case DataControlRowType.EmptyDataRow:
					if (emptyDataRowStyle != null && !emptyDataRowStyle.IsEmpty)
						row.ControlStyle.CopyFrom (emptyDataRowStyle);
					break;
				case DataControlRowType.DataRow:
					if (rowStyle != null && !rowStyle.IsEmpty)
						row.ControlStyle.CopyFrom (rowStyle);
					if ((row.RowState & (DataControlRowState.Edit | DataControlRowState.Insert)) != 0 && editRowStyle != null && !editRowStyle.IsEmpty)
						row.ControlStyle.CopyFrom (editRowStyle);
					if ((row.RowState & DataControlRowState.Insert) != 0 && insertRowStyle != null && !insertRowStyle.IsEmpty)
						row.ControlStyle.CopyFrom (insertRowStyle);
					break;
				default:
					break;
				}
			}
		}