本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.DataGridPoker.GetViewState方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridPoker.GetViewState方法的具体用法?C# DataGridPoker.GetViewState怎么用?C# DataGridPoker.GetViewState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Web.UI.WebControls.DataGridPoker
的用法示例。
在下文中一共展示了DataGridPoker.GetViewState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Styles
public void Styles ()
{
DataGridPoker p = new DataGridPoker ();
StateBag vs = p.GetViewState ();
p.BackImageUrl = "foobar url";
// The styles get stored in the view state
Assert.AreEqual (vs.Count, 0, "A1");
Assert.IsNull (vs ["BackImageUrl"], "A2");
Assert.IsNull (vs ["GridLines"], "A3");
Assert.IsNull (vs ["CellSpacing"], "A4");
}
示例2: ViewState
public void ViewState ()
{
DataGridPoker p = new DataGridPoker ();
StateBag vs = p.GetViewState ();
Assert.AreEqual (vs.Count, 0, "A1");
p.AllowCustomPaging = true;
Assert.AreEqual (vs.Count, 1, "A2");
Assert.AreEqual (vs ["AllowCustomPaging"], true, "A3");
p.AllowCustomPaging = false;
Assert.AreEqual (vs.Count, 1, "A4");
Assert.AreEqual (vs ["AllowCustomPaging"], false, "A5");
p.AllowPaging = true;
Assert.AreEqual (vs.Count, 2, "A6");
Assert.AreEqual (vs ["AllowPaging"], true, "A7");
p.AllowPaging = false;
Assert.AreEqual (vs.Count, 2, "A8");
Assert.AreEqual (vs ["AllowPaging"], false, "A9");
p.AllowSorting = true;
Assert.AreEqual (vs.Count, 3, "A10");
Assert.AreEqual (vs ["AllowSorting"], true, "A11");
p.AllowSorting = false;
Assert.AreEqual (vs.Count, 3, "A12");
Assert.AreEqual (vs ["AllowSorting"], false, "A13");
p.AutoGenerateColumns = true;
Assert.AreEqual (vs.Count, 4, "A14");
Assert.AreEqual (vs ["AutoGenerateColumns"], true, "A15");
p.AutoGenerateColumns = false;
Assert.AreEqual (vs.Count, 4, "A16");
Assert.AreEqual (vs ["AutoGenerateColumns"], false, "A17");
p.CurrentPageIndex = 1;
Assert.AreEqual (vs.Count, 5, "A18");
Assert.AreEqual (vs ["CurrentPageIndex"], 1, "A19");
p.EditItemIndex = 1;
Assert.AreEqual (vs.Count, 6, "A20");
Assert.AreEqual (vs ["EditItemIndex"], 1, "A20");
p.PageSize = 25;
Assert.AreEqual (vs.Count, 7, "A21");
Assert.AreEqual (vs ["PageSize"], 25, "A22");
p.SelectedIndex = 25;
Assert.AreEqual (vs.Count, 8, "A23");
Assert.AreEqual (vs ["SelectedIndex"], 25, "A24");
p.ShowFooter = false;
Assert.AreEqual (vs.Count, 9, "A25");
Assert.AreEqual (vs ["ShowFooter"], false, "A26");
p.ShowFooter = true;
Assert.AreEqual (vs ["ShowFooter"], true, "A27");
p.ShowHeader = false;
Assert.AreEqual (vs.Count, 10, "A28");
Assert.AreEqual (vs ["ShowHeader"], false, "A29");
p.ShowHeader = true;
Assert.AreEqual (vs ["ShowHeader"], true, "A30");
p.VirtualItemCount = 100;
Assert.AreEqual (vs.Count, 11, "A31");
Assert.AreEqual (vs ["VirtualItemCount"], 100, "A32");
}