當前位置: 首頁>>代碼示例>>C#>>正文


C# TableCell.FindControl方法代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.TableCell.FindControl方法的典型用法代碼示例。如果您正苦於以下問題:C# TableCell.FindControl方法的具體用法?C# TableCell.FindControl怎麽用?C# TableCell.FindControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.UI.WebControls.TableCell的用法示例。


在下文中一共展示了TableCell.FindControl方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateSideBar

		void CreateSideBar (TableCell sideBarCell)
		{
			RegisterApplyStyle (sideBarCell, SideBarStyle);

			if (SkipLinkText != "") {
				System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
				anchor.HRef = "#" + ClientID + "_SkipLink";

				Image img = new Image ();
				ClientScriptManager csm = new ClientScriptManager (null);
				img.ImageUrl = csm.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif");
				img.Attributes.Add ("height", "0");
				img.Attributes.Add ("width", "0");
				img.AlternateText = SkipLinkText;

				anchor.Controls.Add (img);
				sideBarCell.Controls.Add (anchor);
			}

			if (sideBarTemplate != null) {
				sideBarTemplate.InstantiateIn (sideBarCell);
				stepDatalist = sideBarCell.FindControl (DataListID) as DataList;
				if (stepDatalist == null)
					throw new InvalidOperationException ("The side bar template must contain a DataList control with id '" + DataListID + "'.");
				stepDatalist.ItemDataBound += new DataListItemEventHandler(StepDatalistItemDataBound);
			} else {
				stepDatalist = new DataList ();
				stepDatalist.ID = DataListID;
				stepDatalist.SelectedItemStyle.Font.Bold = true;
				stepDatalist.ItemTemplate = SideBarItemTemplate;
				sideBarCell.Controls.Add (stepDatalist);
			}

			if (SkipLinkText != "") {
				System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
				anchor.ID = "SkipLink";
				sideBarCell.Controls.Add (anchor);
			}

			stepDatalist.ItemCommand += new DataListCommandEventHandler (StepDatalistItemCommand);
			stepDatalist.CellSpacing = 0;
			stepDatalist.DataSource = WizardSteps;
			stepDatalist.SelectedIndex = ActiveStepIndex;
			stepDatalist.DataBind ();
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:45,代碼來源:Wizard.cs

示例2: CreateSideBar

		void CreateSideBar (TableCell sideBarCell)
		{
			RegisterApplyStyle (sideBarCell, SideBarStyle);
			
			if (sideBarTemplate != null) {
				sideBarTemplate.InstantiateIn (sideBarCell);
				stepDatalist = sideBarCell.FindControl (DataListID) as DataList;
				if (stepDatalist == null)
					throw new InvalidOperationException ("The side bar template must contain a DataList control with id '" + DataListID + "'.");
			} else {
				stepDatalist = new DataList ();
				stepDatalist.ID = DataListID;
				sideBarCell.Controls.Add (stepDatalist);
			}

			stepDatalist.DataSource = WizardSteps;
			stepDatalist.ItemTemplate = sideBarItemTemplate;
			stepDatalist.DataBind ();
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:19,代碼來源:Wizard.cs

示例3: GetValue

		/// <summary>
		/// Gets the current value of the specified <see cref="TableCell"/> object.
		/// </summary>
		/// <param name="cell">The current <see cref="TableCell"/> object.</param>
		/// <param name="controlId">The nested control's ID property value.</param>
		/// <param name="controlProperty">The nested control's value property name.</param>
		/// <returns>The current value.</returns>
		public Object GetValue(TableCell cell, String controlId, String controlProperty)
		{
			Object value = null;

			if ( String.IsNullOrEmpty(controlId) )
			{
				value = cell.Text;
			}
			else
			{
				Control control = cell.FindControl(controlId);
				value = FormUtil.GetValue(control, controlProperty);
			}

			return value;
		}
開發者ID:WildGenie,項目名稱:NetTiers,代碼行數:23,代碼來源:EntityRelationshipMember.cs

示例4: AddTemplateCell

		void AddTemplateCell (TableRow row, ITemplate template, params string[] buttonIds)
		{
			TableCell cell = new TableCell ();
			template.InstantiateIn (cell);
			
			foreach (string id in buttonIds) {
				IButtonControl b = cell.FindControl (id) as IButtonControl;
				if (b != null) RegisterCommandEvents (b);
			}
			
			row.Cells.Add (cell);
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:12,代碼來源:Wizard.cs

示例5: SetValue

		/// <summary>
		/// Sets the current value of the specified <see cref="TableCell"/> object.
		/// </summary>
		/// <param name="cell">The current <see cref="TableCell"/> object.</param>
		/// <param name="controlId">The nested control's ID property value.</param>
		/// <param name="controlProperty">The nested control's value property name.</param>
		/// <param name="value">The current value.</param>
		public void SetValue(TableCell cell, String controlId, String controlProperty, Object value)
		{
			if ( cell != null )
			{
				if ( String.IsNullOrEmpty(controlId) )
				{
					cell.Text = String.Format("{0}", value);
				}
				else
				{
					Control control = cell.FindControl(controlId);
					FormUtil.SetValue(control, controlProperty, value);
				}
			}
		}
開發者ID:WildGenie,項目名稱:NetTiers,代碼行數:22,代碼來源:EntityRelationshipMember.cs


注:本文中的System.Web.UI.WebControls.TableCell.FindControl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。