当前位置: 首页>>代码示例>>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;未经允许,请勿转载。