UpdateColumn() public method

Updates properties of the column, moves the column, and/or renames the column.

You cannot change the type of a Primary column.

While dependencies are enabled on a sheet, you can’t change the type of any special calendar/Gantt columns.

If the column type is changed, all cells in the column will be converted to the new column type.

Type is optional when moving or renaming, but required when changing type or dropdown values.

It mirrors To the following Smartsheet REST API method: GET /sheets/{sheetId}/columns/{columnId}

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public UpdateColumn ( long sheetId, Api.Models.Column column ) : Api.Models.Column
sheetId long the sheet Id
column Api.Models.Column column object to update
return Api.Models.Column
Example #1
0
        public virtual void TestUpdateColumn()
        {
            server.setResponseBody("../../../TestSDK/resources/updateColumn.json");
            IList <string> options = new List <string> {
                "First", "Second", "Third"
            };

            Column col1 = new Column.UpdateColumnBuilder(123, "First Column", 0)
                          .SetType(ColumnType.PICKLIST).SetOptions(options).Build();


            Column newCol = sheetColumnResourcesImpl.UpdateColumn(132, col1);

            Assert.IsTrue(newCol.Type == ColumnType.PICKLIST);
            Assert.IsTrue(newCol.Index == 0);
            Assert.IsTrue(newCol.Id == 5005385858869124);
            Assert.IsTrue(newCol.Title == "First Column");
            Assert.IsTrue(newCol.Options[0] == "One");
            Assert.IsTrue(newCol.Options[1] == "Two");
        }