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