[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheet.AutoGenerateColumns

AutoGenerateColumns Property

AutoGenerateColumns

Gets or sets whether columns are generated automatically when data is bound to the worksheet.

When this property is true, columns can be created automatically during data binding. Use AutoGenerateColumns to change this setting before assigning or refreshing bound data.

Declaration
bool AutoGenerateColumns { get; set; }
Property AutoGenerateColumns As Boolean
Examples
JsonDataSource dataSource = new JsonDataSource("[{\"name\":\"Jack\",\"age\":12},{\"name\":\"Alice\",\"age\":25}]");
worksheet.AutoGenerateColumns = true;
worksheet.DataSource = dataSource;
bool autoGenerateColumns = worksheet.AutoGenerateColumns;
int columnCount = worksheet.ColumnCount;
object firstName = worksheet.Range["A1"].Value;
object secondAge = worksheet.Range["B2"].Value;