本文整理汇总了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");
}