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