# Basic Operations

## Content



This topic discusses about the various basic operations that can be performed on a column in **True DBGrid**.

## Insert Column

True DBGrid lets you add a new column at the specified index using the [Insert](/componentone/docs/win/online-truedbgrid/) method of [C1DataColumnCollection](/componentone/docs/win/online-truedbgrid/) class.

```csharp
C1.Win.TrueDBGrid.C1DataColumn Col = new C1.Win.TrueDBGrid.C1DataColumn();
C1.Win.TrueDBGrid.C1DisplayColumn dc;
c1TruedbGrid1.Columns.Insert(0, Col);
var colName = "Unbound" + c1TruedbGrid1.Columns.Count;
Col.Caption = colName;
dc = c1TruedbGrid1.Splits[0].DisplayColumns[colName];
// Move the newly added column to leftmost position in the grid.
c1TruedbGrid1.Splits[0].DisplayColumns.RemoveAt(c1TruedbGrid1.Splits[0].DisplayColumns.IndexOf(dc));
c1TruedbGrid1.Splits[0].DisplayColumns.Insert(c1TruedbGrid1.Col, dc);
dc.Visible = true;
c1TruedbGrid1.Rebind(true);
```

## Delete Column

To delete a particular column from the grid, you can use the [RemoveAt](/componentone/docs/win/online-truedbgrid/) method of the **C1DataColumnCollection** class

```csharp
if (c1TruedbGrid1.Columns.Count > 0)
    c1TruedbGrid1.Columns.RemoveAt(c1TruedbGrid1.Col);
```

## Set Data Type

True DBGrid lets you set the data type of an unbound column in WinForms True DBGrid using the [DataType](/componentone/docs/win/online-truedbgrid/) property of the [C1DataColumn](/componentone/docs/win/online-truedbgrid/) class as shown in the code below.

```csharp
// Set datatype of a column [only works in Unbound mode]
c1TruedbGrid1.Columns[0].DataType = typeof(string);
```

## Set Frozen Column

Frozen columns, similar to fixed columns, are non-scrollable but can be edited by the user. In True DBGrid, frozen columns can be set by using [Frozen](/componentone/docs/win/online-truedbgrid/) property provided by the [C1DisplayColumn](/componentone/docs/win/online-truedbgrid/) class.

To set frozen columns in the WinForms True DBGrid, use the code below.

```csharp
this.c1TruedbGrid1.Splits[0].DisplayColumns[1].Frozen = true;
```