本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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));
}
示例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");
}