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


C# DataGridPoker.TrackState方法代码示例

本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.DataGridPoker.TrackState方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridPoker.TrackState方法的具体用法?C# DataGridPoker.TrackState怎么用?C# DataGridPoker.TrackState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoTests.System.Web.UI.WebControls.DataGridPoker的用法示例。


在下文中一共展示了DataGridPoker.TrackState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveViewState

		public void SaveViewState ()
		{
			DataGridPoker p = new DataGridPoker ();

			p.TrackState ();

			object [] vs = (object []) p.SaveState ();
			Assert.AreEqual (vs.Length, 11, "A1");

			// By default the viewstate is all null
			for (int i = 0; i < vs.Length; i++)
				Assert.IsNull (vs [i], "A2-" + i);

			//
			// TODO: What goes in the [1] and [9] slots?
			//

			p.AllowPaging = true;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [0], "A3");

			/*
			  This test doesn't work right now. It must be an issue
			  in the DataGridPagerStyle
			  
			p.PagerStyle.Visible = true;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [2], "A5");
			*/
			
			p.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [3], "A6");

			p.FooterStyle.HorizontalAlign = HorizontalAlign.Center;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [4], "A7");

			p.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [5], "A8");

			p.AlternatingItemStyle.HorizontalAlign = HorizontalAlign.Center;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [6], "A9");

			p.SelectedItemStyle.HorizontalAlign = HorizontalAlign.Center;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [7], "A10");

			p.EditItemStyle.HorizontalAlign = HorizontalAlign.Center;
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [8], "A11");

			PagedDataSource source = new PagedDataSource ();
			DataTable table = new DataTable ();
			ArrayList columns;

			table.Columns.Add (new DataColumn ("one", typeof (string)));
			table.Columns.Add (new DataColumn ("two", typeof (string)));
			table.Columns.Add (new DataColumn ("three", typeof (string)));
			source.DataSource = new DataView (table);
			columns = p.CreateColumns (source, true);

			vs = (object []) p.SaveState ();
			Assert.IsNull (vs [9], "A12");
			p.BackImageUrl = "foobar url";
			vs = (object []) p.SaveState ();
			Assert.IsNotNull (vs [9], "A12");

			Assert.IsNotNull (vs [10], "A12");
			Assert.AreEqual (vs [10].GetType (), typeof (object []), "A12");

			object [] cols = (object []) vs [10];
			Assert.AreEqual (cols.Length, 3, "A13");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:76,代码来源:DataGridTest.cs


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