Class OdsCellFieldCollection

OdsCellFieldCollection class

Represents the fields of ODS.

public class OdsCellFieldCollection : CollectionBase<OdsCellField>

Properties

NameDescription
Capacity { get; set; }
Count { get; }
Item { get; }Gets the field by the index. (2 indexers)
Item { get; set; }

Methods

NameDescription
Add(int, int, OdsCellFieldType, string)Adds a field.
BinarySearch(OdsCellField)
BinarySearch(OdsCellField, IComparer<OdsCellField>)
BinarySearch(int, int, OdsCellField, IComparer<OdsCellField>)
Clear()
Contains(OdsCellField)
CopyTo(OdsCellField[])
CopyTo(OdsCellField[], int)
CopyTo(int, OdsCellField[], int, int)
Exists(Predicate<OdsCellField>)
Find(Predicate<OdsCellField>)
FindAll(Predicate<OdsCellField>)
FindIndex(Predicate<OdsCellField>)
FindIndex(int, Predicate<OdsCellField>)
FindIndex(int, int, Predicate<OdsCellField>)
FindLast(Predicate<OdsCellField>)
FindLastIndex(Predicate<OdsCellField>)
FindLastIndex(int, Predicate<OdsCellField>)
FindLastIndex(int, int, Predicate<OdsCellField>)
GetEnumerator()
IndexOf(OdsCellField)
IndexOf(OdsCellField, int)
IndexOf(OdsCellField, int, int)
LastIndexOf(OdsCellField)
LastIndexOf(OdsCellField, int)
LastIndexOf(OdsCellField, int, int)
RemoveAt(int)
UpdateFieldsValue()Update fields value to the cells.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Ods;
    using System;

    public class OdsCellFieldCollectionDemo
    {
        public static void OdsCellFieldCollectionExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            Cells cells = worksheet.Cells;

            // Access the OdsCellFieldCollection
            OdsCellFieldCollection odsCellFields = cells.OdsCellFields;

            // Add fields to the OdsCellFieldCollection
            int fieldIndex1 = odsCellFields.Add(0, 0, OdsCellFieldType.Date, "yyyy-MM-dd");
            int fieldIndex2 = odsCellFields.Add(1, 1, OdsCellFieldType.SheetName, null);
            int fieldIndex3 = odsCellFields.Add(2, 2, OdsCellFieldType.Title, null);

            // Update fields value to the cells
            odsCellFields.UpdateFieldsValue();

            // Save the workbook
            workbook.Save("OdsCellFieldCollectionExample.ods");

            return;
        }
    }
}

See Also