public void SystemColumn() { Grid grid = new Grid(); SystemColumn column = new SystemColumn("column", WebGrid.Enums.SystemColumn.SelectColumn, grid); column.Required = true; SystemColumn column2 = new SystemColumn("column2", WebGrid.Enums.SystemColumn.DeleteColumn, grid); SystemColumn column3 = new SystemColumn("column3", WebGrid.Enums.SystemColumn.CopyColumn, grid); SystemColumn column4 = new SystemColumn("column4", WebGrid.Enums.SystemColumn.EditColumn, grid); SystemColumn column5 = new SystemColumn("column5", WebGrid.Enums.SystemColumn.NewRecordColumn, grid); SystemColumn column6 = new SystemColumn("column6", WebGrid.Enums.SystemColumn.RowColumn, grid); SystemColumn column7 = new SystemColumn("column7", WebGrid.Enums.SystemColumn.DeleteColumn, grid); SystemColumn column8 = new SystemColumn("column8", WebGrid.Enums.SystemColumn.UpdateGridRecordsColumn, grid); grid.MasterTable.Columns.Add(column); grid.MasterTable.Columns.Add(column2); grid.MasterTable.Columns.Add(column3); grid.MasterTable.Columns.Add(column4); grid.MasterTable.Columns.Add(column5); grid.MasterTable.Columns.Add(column6); grid.MasterTable.Columns.Add(column7); grid.MasterTable.Columns.Add(column8); SetupGrid(grid); grid.Mode = Mode.Grid; grid.DataSourceId = "Categories"; grid.ConnectionString = ConnectionAccessOleDb; StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter gridwriter = new HtmlTextWriter(sw); grid.RenderControl(gridwriter); Assert.Greater(grid.MasterTable.Rows.Count, 1); Assert.LessOrEqual(grid.SystemMessage.Count, 1); // 15-day license key message Assert.AreEqual(grid.Mode, Mode.Grid); }
public void SystemColumn() { Grid grid = new Grid(); SystemColumn column = new SystemColumn("column", WebGrid.Enums.SystemColumn.SelectColumn, grid); column.Required = true; SystemColumn column2 = new SystemColumn("column2", WebGrid.Enums.SystemColumn.DeleteColumn, grid); SystemColumn column3 = new SystemColumn("column3", WebGrid.Enums.SystemColumn.CopyColumn, grid); SystemColumn column4 = new SystemColumn("column4", WebGrid.Enums.SystemColumn.EditColumn, grid); SystemColumn column5 = new SystemColumn("column5", WebGrid.Enums.SystemColumn.NewRecordColumn, grid); SystemColumn column6 = new SystemColumn("column6", WebGrid.Enums.SystemColumn.RowColumn, grid); SystemColumn column7 = new SystemColumn("column7", WebGrid.Enums.SystemColumn.DeleteColumn, grid); SystemColumn column8 = new SystemColumn("column8", WebGrid.Enums.SystemColumn.UpdateGridRecordsColumn, grid); grid.MasterTable.Columns.Add(column); grid.MasterTable.Columns.Add(column2); grid.MasterTable.Columns.Add(column3); grid.MasterTable.Columns.Add(column4); grid.MasterTable.Columns.Add(column5); grid.MasterTable.Columns.Add(column6); grid.MasterTable.Columns.Add(column7); grid.MasterTable.Columns.Add(column8); SetupGrid(grid); grid.Mode = Mode.Grid; grid.DataSourceId = "Categories"; grid.ConnectionString = ConnectionAccessOleDb; StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter gridwriter = new HtmlTextWriter(sw); grid.RenderControl(gridwriter); Assert.Greater(grid.MasterTable.Rows.Count, 1); Assert.LessOrEqual(grid.SystemMessage.Count, 1); // 15-day license key message Assert.AreEqual(grid.Mode, Mode.Grid); }