# Lock Method

## Overloads

| [Lock(String, IEnumerable<Int32>)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.GenericObject.Lock.htm#Qlik_Engine_GenericObject_Lock_System_String_System_Collections_Generic_IEnumerable_System_Int32__) |  | Locks the selected values of a generic object. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.GenericObject.Lock.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.GenericObject.Lock.htm)

## Lock(String, IEnumerable&lt;Int32&gt;)

Locks the selected values of a generic object.

### Declaration

```

          public void Lock([QixName("qPath")] string path, [QixName("qColIndices")] IEnumerable<int> colIndices = null)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | path | Path to the definition of the object.<br>For example, `/qListObjectDef` . |
| System.Collections.Generic.IEnumerable&lt;System.Int32&gt; | colIndices | Dimension numbers or dimension indexes where the lock should apply.<br>Dimension numbers/indexes start from 0.<br>If this parameter is not set, the selected values in all dimensions are locked. |

### Implements

[IGenericObject.Lock(String, IEnumerable<Int32>)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IGenericObject.Lock.htm#Qlik_Engine_IGenericObject_Lock_System_String_System_Collections_Generic_IEnumerable_System_Int32__)