當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。