private static long CreateSheet(SmartsheetClient smartsheet) { Column[] columnsToCreate = new Column[] { new Column.CreateSheetColumnBuilder("col 1", true, ColumnType.TEXT_NUMBER).Build(), new Column.CreateSheetColumnBuilder("col 2", false, ColumnType.DATE).Build(), new Column.CreateSheetColumnBuilder("col 3", false, ColumnType.TEXT_NUMBER).Build(), }; Sheet createdSheet = smartsheet.SheetResources.CreateSheet(new Sheet.CreateSheetBuilder("new sheet", columnsToCreate).Build()); Assert.IsTrue(createdSheet.Columns.Count == 3); Assert.IsTrue(createdSheet.Columns[1].Title == "col 2"); return createdSheet.Id.Value; }
///// <summary> ///// Gets the sheet Id. ///// </summary> ///// <returns> the sheet Id </returns> //public virtual long? GetSheetId() //{ // return sheetId; //} ///// <summary> ///// Gets the column Id. ///// </summary> ///// <returns> the sheet Id </returns> //public virtual long? ColumnId //{ // get // { // return columnId; // } //} /// <summary> /// Builds the column. /// </summary> /// <returns> the column </returns> public virtual Column Build() { //if (title == null || sheetId == null || index == null) //{ // throw new MemberAccessException("A title, sheetId, and index are required"); //} Column column = new Column(); column.Id = id; column.index = index; column.title = title; //column.sheetId = sheetId; column.type = type; column.options = options; column.symbol = symbol; column.systemColumnType = systemColumnType; column.autoNumberFormat = autoNumberFormat; column.width = width; column.format = format; column.locked = locked; //column.ID = columnId; return column; }
public virtual Column UpdateColumn(Column column) { throw new NotSupportedException(); }
/// <summary> /// Builds the column. /// </summary> /// <returns> the column </returns> public virtual Column Build() { //if (title == null || type == null || index == null) //{ // throw new MemberAccessException("A title, type, and index must be set."); //} Column column = new Column(); column.title = title; column.type = type; column.options = options; column.symbol = symbol; column.width = width; column.systemColumnType = systemColumnType; column.autoNumberFormat = autoNumberFormat; column.primary = primary; return column; }