---
title: "LinkDataSource.CompId"
url: "https://reference.aspose.com/psd/net/aspose.psd.fileformats.psd.layers.layerresources/linkdatasource/compid/"
product: "Aspose.PSD for .NET API Reference"
description: "LinkDataSource property. Gets or sets the ID of the currently selected comp for the child document which will be 1 if none are selected. Comps are compositions of a page layout which designers can create. Using layer comps you can create manage and view multiple versions of a layout in a single Adobe Photoshop file. A layer comp is a snapshot of a state of the Layers panel. Layer comps save three types of layer options but this property gets the Layer Comp selection identifier for Smart Objects. Layer comps in Smart Objects"
---

{{< psd/tize >}}
## LinkDataSource.CompId property

Gets or sets the ID of the currently selected comp for the child document, which will be -1 if none are selected. Comps are compositions of a page layout which designers can create. Using layer comps, you can create, manage, and view multiple versions of a layout in a single Adobe® Photoshop® file. A layer comp is a snapshot of a state of the Layers panel. Layer comps save three types of layer options but this property gets the Layer Comp selection identifier for Smart Objects. [Layer comps in Smart Objects](https://helpx.adobe.com/photoshop/using/layer-comps.html)

```csharp
public int CompId { get; set; }
```

### Property Value

The ID of the currently selected comp for the child document, which will be -1 if none are selected.

### Exceptions

| exception | condition |
| --- | --- |
| [PsdImageException](../../../aspose.psd.coreexceptions.imageformats/psdimageexception/) | You cannot access the CompId property |

### See Also

* class [LinkDataSource](../)
* namespace [Aspose.PSD.FileFormats.Psd.Layers.LayerResources](../../../aspose.psd.fileformats.psd.layers.layerresources/)
* assembly [Aspose.PSD](../../../)


