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


C# DataGridPoker.CreateControls方法代碼示例

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


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

示例1: CreationEvents

		public void CreationEvents ()
		{
			DataGridPoker p = new DataGridPoker ();
			DataTable table = new DataTable ();

			table.Columns.Add (new DataColumn ("one", typeof (string)));
			table.Columns.Add (new DataColumn ("two", typeof (string)));
			table.Columns.Add (new DataColumn ("three", typeof (string)));
			
			p.DataSource = new DataView (table);

			p.ItemCreated += new DataGridItemEventHandler (ItemCreatedHandler);
			p.ItemDataBound += new DataGridItemEventHandler (ItemDataBoundHandler);

			// No items added yet
			ResetEvents ();
			p.CreateControls (true);
			Assert.IsTrue (item_created, "A1");
			Assert.IsTrue (item_data_bound, "A2");

			table.Rows.Add (new object [] { "1", "2", "3" });

			ResetEvents ();
			p.CreateControls (true);
			Assert.IsTrue (item_created, "A3");
			Assert.IsTrue (item_data_bound, "A4");

			// no databinding
			ResetEvents ();
			p.CreateControls (false);
			Assert.IsTrue (item_created, "A5");
			Assert.IsFalse (item_data_bound, "A6");
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:33,代碼來源:DataGridTest.cs

示例2: OneTemplateColumn2

		public void OneTemplateColumn2 ()
		{
			DataGridPoker p = new DataGridPoker ();
			p.ShowFooter = true;
			p.AutoGenerateColumns = false;
			p.DataSource = new ArrayList ();
			TemplateColumn tc = new TemplateColumn ();
			tc.HeaderText = " ";
			tc.FooterTemplate = new MyTemplate ("hola");
			p.Columns.Add (tc);
			Assert.AreEqual (1, p.Columns.Count, "columns-1");
			Assert.AreEqual (0, p.Controls.Count, "controls-1");
			p.CreateControls (true);
			// This time we have the table there. Thanks to the empty ArrayList
			Assert.AreEqual (1, p.Columns.Count, "columns-2");
			Assert.AreEqual (1, p.Controls.Count, "controls-2");
			p.PrepareCH ();
			Assert.AreEqual (1, p.Columns.Count, "columns-3");
			Assert.AreEqual (1, p.Controls.Count, "controls-3");
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:20,代碼來源:DataGridTest.cs

示例3: CreateControls

		public void CreateControls ()
		{
			DataGridPoker p = new DataGridPoker ();
			DataTable table = new DataTable ();

			table.Columns.Add (new DataColumn ("one", typeof (string)));
			table.Columns.Add (new DataColumn ("two", typeof (string)));
			table.Columns.Add (new DataColumn ("three", typeof (string)));
			table.Rows.Add (new object [] { "1", "2", "3" });
			
			p.DataSource = new DataView (table);

			p.CreateControls (true);
			Assert.AreEqual (p.Controls.Count, 1, "A1");

			ShowControlsRecursive (p.Controls [0], 1);
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:17,代碼來源:DataGridTest.cs

示例4: OneTemplateColumn1

		public void OneTemplateColumn1 ()
		{
			DataGridPoker p = new DataGridPoker ();
			TemplateColumn tc = new TemplateColumn ();
			tc.ItemTemplate = new MyTemplate ("hola");
			p.Columns.Add (tc);
			ControlCollection controls = p.Controls;
			p.CreateControls (true);
			Assert.AreEqual (1, p.Columns.Count, "columns");
			Assert.AreEqual (0, controls.Count, "controls");
			string render = p.Render ();
			// no items, even with a templated column.
			// The table is not added if DataSource == null
			Assert.IsTrue (-1 == render.IndexOf ("hola"), "template");
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:15,代碼來源:DataGridTest.cs


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