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


C# DataGridPoker.GetViewState方法代码示例

本文整理汇总了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");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:13,代码来源:DataGridTest.cs

示例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");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:67,代码来源:DataGridTest.cs


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