本文整理汇总了C#中PokerDetailsView.SetRequiresDataBinding方法的典型用法代码示例。如果您正苦于以下问题:C# PokerDetailsView.SetRequiresDataBinding方法的具体用法?C# PokerDetailsView.SetRequiresDataBinding怎么用?C# PokerDetailsView.SetRequiresDataBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PokerDetailsView
的用法示例。
在下文中一共展示了PokerDetailsView.SetRequiresDataBinding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DetailsView_PageCount
public void DetailsView_PageCount () {
Page p = new Page ();
PokerDetailsView gv = new PokerDetailsView ();
p.Controls.Add (gv);
ObjectDataSource data = new ObjectDataSource ();
data.ID = "ObjectDataSource1";
data.TypeName = typeof (TableObject).AssemblyQualifiedName;
data.SelectMethod = "GetMyData";
p.Controls.Add (data);
gv.DataSourceID = "ObjectDataSource1";
gv.DataKeyNames = new string [] { "ID", "FName" };
gv.SetRequiresDataBinding (true);
Assert.AreEqual (0, gv.PageCount, "PageCount before binding");
gv.DataBind ();
Assert.AreEqual (3, gv.PageCount, "PageCount after binding");
//PokerDetailsView copy = new PokerDetailsView ();
//object state = gv.SaveState ();
//copy.LoadState (state);
//Assert.AreEqual (3, copy.PageCount, "PageCount from ViewState");
}
示例2: DetailsView_PageIndex3
public void DetailsView_PageIndex3 ()
{
PokerDetailsView dv = new PokerDetailsView ();
dv.AutoGenerateRows = false;
dv.Fields.Add (new TemplateField ());
dv.Page = new Page ();
dv.PageIndex = 10;
dv.DefaultMode = DetailsViewMode.Insert;
dv.SetRequiresDataBinding (true);
Assert.AreEqual (0, dv.PageCount, "#0");
Assert.AreEqual (-1, dv.PageIndex, "#1");
dv.DataSource = myds;
dv.DoEnsureDataBound ();
Assert.AreEqual (0, dv.PageCount, "#2");
Assert.AreEqual (-1, dv.PageIndex, "#3");
dv.ChangeMode (DetailsViewMode.ReadOnly);
Assert.AreEqual (0, dv.PageCount, "#4");
Assert.AreEqual (10, dv.PageIndex, "#5");
}