当前位置: 首页>>代码示例>>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;未经允许,请勿转载。