當前位置: 首頁>>代碼示例>>C#>>正文


C# Grid.Dispose方法代碼示例

本文整理匯總了C#中WebGrid.Grid.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# Grid.Dispose方法的具體用法?C# Grid.Dispose怎麽用?C# Grid.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WebGrid.Grid的用法示例。


在下文中一共展示了Grid.Dispose方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GridSearchEvents

        public void GridSearchEvents()
        {
            Grid grid = new Grid();
            grid.SearchChanged += grid_SearchChangedEvents;
            CreateNewCategory(grid);
            grid.Page = Testpage;
            grid.Search = "DoesNotExist";
            grid.RaisePostBackEvent("RecordCancelClick!");

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Grid);
            Assert.AreEqual(grid.MasterTable.Rows.Count, 0);
            //Assert.IsTrue(searcheventrunnned);
            // Is not triggered because HttpContext is missing during the test phase.
        }
開發者ID:webgrid,項目名稱:WebGrid,代碼行數:20,代碼來源:GridEvents.cs

示例2: GridRowClickEvents

        public void GridRowClickEvents()
        {
            Grid grid = new Grid();

            CreateNewCategory(grid);
            grid.RaisePostBackEvent("RecordCancelClick!");

            grid.RowClick += grid_RowClickEventsAccepted;
            grid.RaisePostBackEvent("RecordClick!!6");
            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Grid);
            Assert.Greater(grid.MasterTable.Rows.Count, 1);

            grid = new Grid();

            CreateNewCategory(grid);
            grid.RaisePostBackEvent("RecordCancelClick!");

            grid.RowClick += grid_RowClickEventsCancel;
            grid.RaisePostBackEvent("RecordClick!!6");
            sb = new StringBuilder();
            sw = new StringWriter(sb);
            gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Detail);
            Assert.AreEqual(grid.MasterTable.Rows.Count, 1);
        }
開發者ID:webgrid,項目名稱:WebGrid,代碼行數:34,代碼來源:GridEvents.cs

示例3: GridNewRecordEventClickDisallow

        public void GridNewRecordEventClickDisallow()
        {
            Grid grid = new Grid();
            grid.NewRecordClick += grid_NewRecordClickNewRecordDisallow;
            CreateNewCategory(grid);

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();

            Assert.Greater(grid.MasterTable.Rows.Count, 1);
            Assert.AreEqual(grid.DisplayView, DisplayView.Grid);
            Assert.IsTrue(newrecordclickdisallow);
        }
開發者ID:webgrid,項目名稱:WebGrid,代碼行數:17,代碼來源:GridEvents.cs

示例4: GridLifeCycleEvents

        public void GridLifeCycleEvents()
        {
            Grid grid = new Grid();

            CreateNewCategory(grid);
            grid.RaisePostBackEvent("RecordCancelClick!");
            grid.BeforeRows += grid_BeforeRowsEvents;
            grid.AfterRows += grid_AfterRowsEvents;
            grid.Complete += grid_CompleteEvents;
            grid.Load += grid_LoadEvents;
            grid.PreRender += grid_PreRenderEvents;
            grid.RaisePostBackEvent("ElementPostBack!CategoryName");

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Grid);
            Assert.Greater(grid.MasterTable.Rows.Count, 1);

            Assert.IsTrue(executedgridlifeprerender);
            Assert.IsTrue(executedgridlifeloadevents);

            Assert.IsTrue(executedgridlifecompleteevents);
            Assert.IsTrue(gridlifeafterrowsevents);
            Assert.IsTrue(gridlifeafterrowsevents);
            Assert.IsTrue(gridlifebeforeevents);
        }
開發者ID:webgrid,項目名稱:WebGrid,代碼行數:30,代碼來源:GridEvents.cs

示例5: GridEditRowEvents

        public void GridEditRowEvents()
        {
            Grid grid = new Grid();
            grid.EditRow += grid_EditRowPostBackCancel;

            grid.DataSourceId = "Categories";
            grid.ID = "test";
            grid.ConnectionString = ConnectionAccessOleDb;
            grid.DefaultVisibility = Visibility.Both;
            grid.RecordsPerRow = 2;
            grid.PagerSettings.PagerType = PagerType.None;
            grid.Width = Unit.Pixel(1000);
            grid.RaisePostBackEvent("RecordClick!!6");

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Grid);
            Assert.Greater(grid.MasterTable.Rows.Count, 1);

            grid = new Grid();

            CreateNewCategory(grid);
            grid.RaisePostBackEvent("RecordCancelClick!");

            grid.EditRow += grid_EditRowCodeCancel;
            grid.EditIndex = "6";
            grid.DisplayView = DisplayView.Detail;
            sb = new StringBuilder();
            sw = new StringWriter(sb);
            gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Grid);
            Assert.Greater(grid.MasterTable.Rows.Count, 1);

            grid = new Grid();

            CreateNewCategory(grid);
            grid.RaisePostBackEvent("RecordCancelClick!");

            grid.EditRow += grid_EditRowSuccess;
            grid.RaisePostBackEvent("RecordClick!!6");
            sb = new StringBuilder();
            sw = new StringWriter(sb);
            gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();
            Assert.AreEqual(grid.DisplayView, DisplayView.Detail);
            Assert.AreEqual(grid.MasterTable.Rows.Count, 1);
        }
開發者ID:webgrid,項目名稱:WebGrid,代碼行數:56,代碼來源:GridEvents.cs

示例6: GridCancelEventClickDisallow

        public void GridCancelEventClickDisallow()
        {
            Grid grid = new Grid();

            CreateNewCategory(grid);
            grid.RecordCancelClick += grid_RecordCancelClickEvents;
            grid.RaisePostBackEvent("RecordCancelClick!");

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            ////grid.ReLoadData = true;
            grid.RenderControl(gridwriter);
            grid.Dispose();

            Assert.AreEqual(grid.MasterTable.Rows.Count, 1);
            Assert.AreEqual(grid.DisplayView, DisplayView.Detail);
            Assert.IsTrue(recordcancelclickrunned);
        }
開發者ID:webgrid,項目名稱:WebGrid,代碼行數:19,代碼來源:GridEvents.cs


注:本文中的WebGrid.Grid.Dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。