当前位置: 首页>>代码示例>>C#>>正文


C# TestDataList.DataBind方法代码示例

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


在下文中一共展示了TestDataList.DataBind方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectedValue_SelectedIndex

		public void SelectedValue_SelectedIndex ()
		{
			// Test for bug https://bugzilla.novell.com/show_bug.cgi?id=376519
			DataTable table = new DataTable();
			table.Columns.Add("id");
			table.Columns.Add("text");

			table.Rows.Add(new object[] {"id1", "Item N1"});
			table.Rows.Add(new object[] {"id2", "Item N2"});
			table.Rows.Add(new object[] {"id3", "Item N3"});
			
			TestDataList dl = new TestDataList ();
			dl.DataKeyField = "id";
			dl.DataSource = table;
			dl.DataBind ();

			Assert.AreEqual (null, dl.SelectedValue, "A1");
			dl.SelectedIndex = 0;
			Assert.AreEqual ("id1", dl.SelectedValue.ToString (), "A2");
		}		
开发者ID:whereisaaron,项目名称:mono,代码行数:20,代码来源:DataListTest.cs

示例2: Controls

		public void Controls ()
		{
			TestDataList dl = new TestDataList ();
			Assert.AreEqual (0, dl.Controls.Count, "Controls-1");
			Assert.AreEqual (0, dl.Items.Count, "Items-1");
			dl.DataSource = GetDataSource (3);
			Assert.AreEqual (0, dl.Controls.Count, "Controls-2");
			Assert.AreEqual (0, dl.Items.Count, "Items-2");
			dl.DataBind ();
			Assert.AreEqual (0, dl.Controls.Count, "Controls-3");
			Assert.AreEqual (0, dl.Items.Count, "Items-3");
		}
开发者ID:whereisaaron,项目名称:mono,代码行数:12,代码来源:DataListTest.cs

示例3: RepeatedItemCount

		public void RepeatedItemCount ()
		{
			TestDataList dl = new TestDataList ();
			IRepeatInfoUser riu = (dl as IRepeatInfoUser);
			dl.DataSource = GetData (10);
			Assert.AreEqual (0, riu.RepeatedItemCount, "before Bind");
			dl.DataBind ();
			Assert.AreEqual (10, riu.RepeatedItemCount, "after Bind");
		}
开发者ID:whereisaaron,项目名称:mono,代码行数:9,代码来源:DataListTest.cs

示例4: GetItemStyle_Separator

		public void GetItemStyle_Separator ()
		{
			TestDataList dl = new TestDataList ();
			dl.DataSource = GetData (6);
			dl.DataBind ();
			IRepeatInfoUser riu = (dl as IRepeatInfoUser);
			Assert.IsNull (riu.GetItemStyle (ListItemType.Separator, 0));
		}
开发者ID:whereisaaron,项目名称:mono,代码行数:8,代码来源:DataListTest.cs

示例5: ProperTemplateSelectedIndexEqualsEditIndex

		public void ProperTemplateSelectedIndexEqualsEditIndex ()
		{
			TestDataList dl = new TestDataList();
			dl.ItemTemplate = new ItemTemplate();
			dl.AlternatingItemTemplate = new ItemTemplate();
			dl.SelectedItemTemplate = new ItemTemplate();
			dl.EditItemTemplate = new EditItemTemplate();
			dl.DataSource = GetData(5);
			dl.SelectedIndex = 0;
			dl.EditItemIndex = 0;
			dl.DataBind();
			object canIGetMyEditItem = dl.Items[dl.EditItemIndex].FindControl("eitemtmpl");
			Assert.IsTrue(canIGetMyEditItem != null, "ProperTemplateSelectedIndexEqualsEditIndex");
		}
开发者ID:whereisaaron,项目名称:mono,代码行数:14,代码来源:DataListTest.cs


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