# GetColByKey

Use the GetColByKey method to get the client-side column index for the specified server-side column index. Learn its syntax and parameters in the documentation.

## Content

Gets the client-side column index for the specified server-side column index.

## Syntax

[JavaScript]

```javascript
var ret = FpSpread1.GetColByKey(FPKey);
```

## Parameters

*FPKey*
Integer, index of the server-side column key (Spread control's column index)

## Return Type

Integer, index of the client-side column

## Remarks

This method returns the index of the column based on the Spread column key. You may have more than one table of columns if you have frozen columns. The Spread column key is unique for each column.

## Example

This is a sample that contains the method. On the client side, the script that contains the method would look like this:

```javascript
<script type="text/javascript">
   function getHValue() {
       var ss = document.getElementById("FpSpread1");
       var totalRow = ss.GetColByKey(10);
   }
</script>
```

## See Also

[GetTopRowIndex](/spreadnet/docs/latest/online-asp/overview/spweb-clientscriptref/clientscript-members/clientscript-allmeths/CSSR-GetTopRowIndex)
[GetRowByKey](/spreadnet/docs/latest/online-asp/overview/spweb-clientscriptref/clientscript-members/clientscript-allmeths/CSSR-GetRowByKey)
[Scripting Members](/spreadnet/docs/latest/online-asp/overview/spweb-clientscriptref/clientscript-members)