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


C# WebControls.PokerGridView类代码示例

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


PokerGridView类属于MonoTests.System.Web.UI.WebControls命名空间,在下文中一共展示了PokerGridView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GridView_Init

		public static void GridView_Init (Page p)
		{
			PokerGridView gv = new PokerGridView ();
			DS data = new DS ();
			p.Controls.Add (gv);
			p.Controls.Add (data);
			data.TypeName = typeof (DS).AssemblyQualifiedName;
			data.SelectMethod = "GetList";
			data.ID = "Data";
			gv.DataBinding += new EventHandler (data_DataBinding);
			gv.DataSourceID = "Data";
		}
开发者ID:nobled,项目名称:mono,代码行数:12,代码来源:GridViewTest.cs

示例2: GridView_DeleteItem

		public void GridView_DeleteItem ()
		{
			PokerGridView g = new PokerGridView ();
			ArrayList myds = new ArrayList ();
			myds.Add ("Norway");
			myds.Add ("Sweden");
			myds.Add ("France");
			myds.Add ("Italy");

			g.DataSource = myds;
			g.DataBind ();
			Assert.AreEqual (false, deleteitemchecker, "DeleteItem#1");
			g.RowDeleting += new GridViewDeleteEventHandler (RowDeletingHandler);
			g.DeleteRow (0);
			Assert.AreEqual (true, deleteitemchecker, "DeleteItem#2");
		}
开发者ID:nobled,项目名称:mono,代码行数:16,代码来源:GridViewTest.cs

示例3: GridView_CreateAutoGeneratedColumn

		public void GridView_CreateAutoGeneratedColumn ()
		{
			PokerGridView g = new PokerGridView ();
			AutoGeneratedFieldProperties fp = new AutoGeneratedFieldProperties();
			fp.Name = "testfield";
			fp.Type = typeof (string);
			AutoGeneratedField gf = g.DoCreateAutoGeneratedColumn (fp);
			Assert.AreEqual (typeof (string), gf.DataType , "AutoGeneratedColumn#1");
			Assert.AreEqual ("testfield", gf.HeaderText, "AutoGeneratedColumn#2");
			Assert.AreEqual ("System.Web.UI.WebControls.AutoGeneratedField", gf.GetType ().ToString (), "AutoGeneratedColumn#3");
		}
开发者ID:nobled,项目名称:mono,代码行数:11,代码来源:GridViewTest.cs

示例4: GridView_DataKeys

		public void GridView_DataKeys ()
		{
			Page p = new Page ();

			PokerGridView gv = new PokerGridView ();
			p.Controls.Add (gv);

			ObjectDataSource data = new ObjectDataSource ();
			data.TypeName = typeof (DataObject).AssemblyQualifiedName;
			data.SelectMethod = "Select";
			p.Controls.Add (data);

			gv.DataSource = data;
			gv.DataKeyNames = new string [] { "ID", "FName" };

			DataKeyArray keys1 = gv.DataKeys;

			Assert.AreEqual (0, keys1.Count, "DataKeys count before binding");

			gv.DataBind ();

			DataKeyArray keys2 = gv.DataKeys;
			DataKeyArray keys3 = gv.DataKeys;

			Assert.IsFalse (Object.ReferenceEquals (keys1, keys2), "DataKey returns the same instans");
			Assert.IsTrue (Object.ReferenceEquals (keys2, keys3), "DataKey returns the same instans");

			Assert.AreEqual (1, keys1.Count, "DataKeys count after binding");
			Assert.AreEqual (1001, keys1 [0].Value, "DataKey.Value after binding");
			Assert.AreEqual (2, keys1 [0].Values.Count, "DataKey.Values count after binding");
			Assert.AreEqual (1001, keys1 [0].Values [0], "DataKey.Values[0] after binding");
			Assert.AreEqual ("Mahesh", keys1 [0].Values [1], "DataKey.Values[1] after binding");

			PokerGridView copy = new PokerGridView ();
			object state = gv.DoSaveControlState ();
			copy.DoLoadControlState (state);

			DataKeyArray keys4 = copy.DataKeys;

			Assert.AreEqual (1, keys4.Count, "DataKeys count from ControlState");
			Assert.AreEqual (1001, keys4 [0].Value, "DataKey.Value from ControlState");
			Assert.AreEqual (2, keys4 [0].Values.Count, "DataKey.Values count from ControlState");
			Assert.AreEqual (1001, keys4 [0].Values [0], "DataKey.Values[0] from ControlState");
			Assert.AreEqual ("Mahesh", keys4 [0].Values [1], "DataKey.Values[1] from ControlState");
		}
开发者ID:nobled,项目名称:mono,代码行数:45,代码来源:GridViewTest.cs

示例5: GridView_DataBind

		public void GridView_DataBind()
		{
			PokerGridView g = new PokerGridView ();
			g.DataSource = myds;
			g.DataBind ();
			Assert.AreEqual (6, g.Rows.Count, "DataBind");

			g.DataSource = null;
			g.DataBind ();
			Assert.AreEqual (0, g.Rows.Count, "DataBind");
		}
开发者ID:nobled,项目名称:mono,代码行数:11,代码来源:GridViewTest.cs

示例6: SortedDescendingHeaderStyle

		public void SortedDescendingHeaderStyle ()
		{
			var g = new PokerGridView ();

			Assert.IsNotNull (g.SortedDescendingHeaderStyle, "#A1-1");
		}
开发者ID:nobled,项目名称:mono,代码行数:6,代码来源:GridViewTest.cs

示例7: GridView_Sort_and_DataSourceSelectArguments

		public void GridView_Sort_and_DataSourceSelectArguments ()
		{
			DataSourceView view;
			DataSourceSelectArguments arg;
			Page p = new Page ();

			PokerGridView g = new PokerGridView ();
			g.Columns.Add (new BoundField ());
			g.AllowSorting = true;
			p.Controls.Add (g);

			ObjectDataSource data = new ObjectDataSource ();
			data.TypeName = typeof (DataSourceObject).AssemblyQualifiedName;
			data.SelectMethod = "GetList";
			data.SortParameterName = "sortExpression";
			data.ID = "Data";
			p.Controls.Add (data);

			g.DataSourceID = "Data";
			g.EditIndex = 2;
			g.PageIndex = 1;
			g.DataBind ();
			
			g.Sort ("sort", SortDirection.Descending);

			Assert.AreEqual (-1, g.EditIndex, "EditIndex after Sort, Bound by DataSourceID");
			Assert.AreEqual (0, g.PageIndex, "PageIndex after Sort, Bound by DataSourceID");

			arg = g.DoCreateDataSourceSelectArguments();
			view = g.DoGetData ();
			Assert.IsTrue (view.CanSort);
			Assert.AreEqual ("sort", g.SortExpression, "SortExpression, Bound by DataSourceID");
			Assert.AreEqual (SortDirection.Descending, g.SortDirection, "SortDirection, Bound by DataSourceID");
			Assert.AreEqual ("sort DESC", arg.SortExpression, "AllowSorting = true, Bound by DataSourceID");

			g.AllowSorting = false;
			arg = g.DoCreateDataSourceSelectArguments ();
			Assert.AreEqual ("sort DESC", arg.SortExpression, "AllowSorting = false, Bound by DataSourceID");
		}
开发者ID:nobled,项目名称:mono,代码行数:39,代码来源:GridViewTest.cs

示例8: RenderAllowPaging

		public static void RenderAllowPaging (Page p)
		{
			ArrayList myds = new ArrayList ();
			myds.Add ("Norway");
			myds.Add ("Sweden");
			myds.Add ("France");
			myds.Add ("Italy");
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			PokerGridView b = new PokerGridView ();
			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (b);
			b.AllowPaging = true;
			b.PageSize = 2;
			b.DataSource = myds;
			b.DataBind ();
			p.Form.Controls.Add (lce);
		}
开发者ID:nobled,项目名称:mono,代码行数:18,代码来源:GridViewTest.cs

示例9: RenderAllowPaging2

		public static void RenderAllowPaging2 (Page p)
		{
			ArrayList myds = new ArrayList ();
			myds.Add ("Norway");
			myds.Add ("Sweden");
			myds.Add ("France");
			myds.Add ("Italy");
			myds.Add ("Norway");
			myds.Add ("Sweden");
			myds.Add ("France");
			myds.Add ("Italy");
			myds.Add ("Norway");
			myds.Add ("Sweden");
			myds.Add ("France");
			myds.Add ("Italy");
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			PokerGridView b = new PokerGridView ();
			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (b);
			b.AllowPaging = true;
			b.PageSize = 2;
			b.PageIndex = 1;
			b.PagerSettings.PageButtonCount = 4;
			b.PagerSettings.Mode= PagerButtons.NumericFirstLast;
			b.DataSource = myds;
			b.DataBind ();
			p.Form.Controls.Add (lce);
		}
开发者ID:nobled,项目名称:mono,代码行数:29,代码来源:GridViewTest.cs

示例10: GridView_DefaultsRender

		public void GridView_DefaultsRender ()
		{
			PokerGridView b = new PokerGridView ();
			string html = b.Render ();
			Assert.AreEqual(-1 ,b.Render().IndexOf("table"), "RenderViewState");
		}
开发者ID:nobled,项目名称:mono,代码行数:6,代码来源:GridViewTest.cs

示例11: GridView_Render

		public void GridView_Render ()
		{
			PokerGridView b = new PokerGridView ();
			b.DataSource = myds;
			b.DataBind ();
			string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Item</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Norway</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Sweden</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>France</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Italy</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Israel</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Russia</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
			string RenderedControlHtml = b.Render ();
			HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Rendering");
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:GridViewTest.cs

示例12: GridView_State

		public void GridView_State ()
		{
			PokerGridView g = new PokerGridView ();
			PokerGridView copy = new PokerGridView ();

			string[] test = new String[1];
			test[0] = "test";
			g.DataKeyNames = test;
			g.EditIndex = 0;
			g.PageIndex = 2;
					
			object state = g.DoSaveControlState ();
			copy.DoLoadControlState (state);

			Assert.AreEqual ("test", copy.DataKeyNames[0], "DataKeyNames");
			Assert.AreEqual (0, copy.EditIndex, "EditIndex");
			Assert.AreEqual (2, copy.PageIndex, "PageIndex");
			
		}
开发者ID:nobled,项目名称:mono,代码行数:19,代码来源:GridViewTest.cs

示例13: GridView_PrepareControlHierarchy

		public void GridView_PrepareControlHierarchy ()
		{
			PokerGridView gv = new PokerGridView ();
			gv.controlHierarchy = false;
			gv.Render ();
			Assert.AreEqual (0, gv.Controls.Count, "ControlHierarchy_ControlsCount");
			Assert.AreEqual (true, gv.controlHierarchy, "ControlHierarchy_FirstFlow");
			gv.DataSource = myds;
			gv.DataBind ();
			gv.controlHierarchy = false;
			gv.Render ();
			Assert.AreEqual (1, gv.Controls.Count, "ControlHierarchy_ControlsCountSecondaryFlow");
			Assert.AreEqual (true, gv.controlHierarchy, "ControlHierarchy_SecondaryFlow");
		}
开发者ID:nobled,项目名称:mono,代码行数:14,代码来源:GridViewTest.cs

示例14: GridView_PerformDataBiding

		public void GridView_PerformDataBiding ()
		{
			PokerGridView gv = new PokerGridView ();
			gv.DoPerformDataBinding (myds);
			Assert.AreEqual (6, gv.Rows.Count, "PerformDataBiding_Rows");
		}
开发者ID:nobled,项目名称:mono,代码行数:6,代码来源:GridViewTest.cs

示例15: GridView_AssignedProperties

		public void GridView_AssignedProperties ()
		{
			PokerGridView g = new PokerGridView ();
			Assert.AreEqual (0, g.StateBag.Count, "ViewState.Count");
			g.AllowPaging = true;
			Assert.AreEqual (true, g.AllowPaging, "AllowPaging");
			g.AllowSorting = true;
			Assert.AreEqual (true, g.AllowSorting, "AllowSorting");
			g.AutoGenerateColumns = false;
			Assert.AreEqual (false, g.AutoGenerateColumns, "AutoGenerateColumns");
			g.AutoGenerateDeleteButton = true;
			Assert.AreEqual (true, g.AutoGenerateDeleteButton, "AutoGenerateDeleteButton");
			g.AutoGenerateEditButton = true;
			Assert.AreEqual (true, g.AutoGenerateEditButton, "AutoGenerateEditButton");
			g.AutoGenerateSelectButton = true;
			Assert.AreEqual (true, g.AutoGenerateSelectButton, "AutoGenerateSelectButton");
			g.BackImageUrl = "test";
			Assert.AreEqual ("test", g.BackImageUrl, "BackImageUrl");
			g.Caption = "test";
			Assert.AreEqual ("test", g.Caption, "Caption");
			g.CaptionAlign = TableCaptionAlign.Left;
			Assert.AreEqual (TableCaptionAlign.Left, g.CaptionAlign, "CaptionAlign");
			g.CellPadding = 0;
			Assert.AreEqual (0, g.CellPadding, "CellPadding");
			g.CellSpacing = 1;
			Assert.AreEqual (1, g.CellSpacing, "CellSpacing");
			// ToDo: The Columns property default value is tested by the DataControlFieldCollection and DataControlField tests
			string[] str = new String[1];
			str[0] = "test";
			g.DataKeyNames = str;
			Assert.AreEqual ("test", g.DataKeyNames[0], "DataKeyNames");
			
			// ToDo: The DataKeys property default value is tested by the DataKeyArray and DataKey tests
			g.EditIndex = 0;
			Assert.AreEqual (0, g.EditIndex, "EditIndex");
			// The EditRowStyle property default value is tested by the TableItemStyle test (already exists)
			// The EmptyDataRowStyle property default value is tested by the TableItemStyle test (already exists)
			
			MyWebControl.Image myImage = new MyWebControl.Image ();
			myImage.ImageUrl = "myimage.jpg";
			ImageTemplate template = new ImageTemplate ();
			template.MyImage = myImage;
			// end create template image

			g.EmptyDataTemplate = template;
			Assert.IsNotNull (g.EmptyDataTemplate, "EmptyDataTemplate");
			g.EmptyDataText = "test";
			Assert.AreEqual ("test", g.EmptyDataText, "EmptyDataText");

			g.EnableSortingAndPagingCallbacks = true;
			Assert.AreEqual (true, g.EnableSortingAndPagingCallbacks, "EnableSortingAndPagingCallbacks");

			// The FooterStyle property default value is tested by the TableItemStyle test (already exists)
			g.GridLines = GridLines.Horizontal;
			Assert.AreEqual (GridLines.Horizontal, g.GridLines, "GridLines");

			g.HorizontalAlign = HorizontalAlign.Justify;
			Assert.AreEqual (HorizontalAlign.Justify, g.HorizontalAlign, "HorizontalAlign");

			g.PageIndex = 1;
			Assert.AreEqual (1, g.PageIndex, "PageIndex");
			// ToDo: The PagerSettings property default value is tested by the PagerSettings test
			// The PagerStyle property default value is tested by the TableItemStyle test (already exists)
			g.PagerTemplate = template;
			Assert.IsNotNull (g.PagerTemplate, "PagerTemplate");
			g.PageSize = 5;
			Assert.AreEqual (5, g.PageSize, "PageSize");
			g.RowHeaderColumn = "test";
			Assert.AreEqual ("test", g.RowHeaderColumn, "RowHeaderColumn");
			// ToDo: The Rows property default value is tested by the GridViewRowCollection and GridViewRow test			
			// The RowStyle property default value is tested by the TableItemStyle test (already exists)
			g.ShowFooter = true;
			Assert.AreEqual (true, g.ShowFooter, "ShowFooter");
			g.ShowHeader = false;
			Assert.AreEqual (false, g.ShowHeader, "ShowHeader");
			g.UseAccessibleHeader = false;
			Assert.AreEqual (false, g.UseAccessibleHeader, "UseAccessibleHeader");
		}
开发者ID:nobled,项目名称:mono,代码行数:78,代码来源:GridViewTest.cs


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