[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ICustomXmlPartCollection.Item

this Property

this[string]

Gets the Custom XML part with the specified ID.

The ID is the value returned by Id. This lookup is useful after a workbook is reopened or when multiple Custom XML parts are stored in the same workbook.

Declaration
ICustomXmlPart this[string id] { get; }
ReadOnly Default Property Item(id As String) As ICustomXmlPart
Parameters
Type Name Description
string id

The ID of the Custom XML part.

Property Value
Type Description
ICustomXmlPart

The Custom XML part with the specified ID, or null if it is not found.

Examples
ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
string id = customXmlPart.Id;

ICustomXmlPart samePart = workbook.CustomXmlParts[id];

this[int]

Gets the Custom XML part at the specified zero-based index.

Use the index to enumerate or access parts in collection order. If the index is outside the valid range, an ArgumentOutOfRangeException is thrown.

Declaration
ICustomXmlPart this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As ICustomXmlPart
Parameters
Type Name Description
int index

The zero-based index of the Custom XML part.

Property Value
Type Description
ICustomXmlPart

The Custom XML part at the specified index.

Examples
if (workbook.CustomXmlParts.Count > 0)
{
    ICustomXmlPart firstPart = workbook.CustomXmlParts[0];
    byte[] xmlData = firstPart.Data;
}
Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when index is outside the valid range.