# Customize Border

FlexGrid for WinForms lets you set custom borders on individual cells, row or column cells, and even the whole grid. Learn more about customizing borders here.

## Content

The FlexGrid control lets you customize the border of grid, row, column and even cells by changing its style, color direction and so on.

![Customize Borders](https://cdn.mescius.io/document-site-files/images/2f10b028-0ae8-4c29-a102-4d67578c339b/images/customize-border.png)

## Customize Grid Border

To customize border of the grid control, you can use the **BorderStyle** property which accepts values from **BorderStyleEnum** provided by the <span data-popup-content="This namespace is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="C1.Win.FlexGrid.Util.BaseControls" data-popup-theme="ui-tooltip-green qtip-green">C1.Win.FlexGrid.Util.BaseControls</span> namespace.

Following code shows how to customize border of the WinForms FlexGrid control.

```csharp
// Change the grid border to a three dimensional border
c1FlexGrid1.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D;               
```

```vbnet
' Change the grid border to a three dimensional border
c1FlexGrid1.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D              
```

## Customize Row/Column Border

To customize the border style of a particular row or column, you must access the **'Border'** item of <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022C1.Win.FlexGrid.5~C1.Win.FlexGrid.CellStyle.html\u0022\u003e.NET\u003c/a\u003e." data-popup-title="CellStyle" data-popup-theme="ui-tooltip-green qtip-green">CellStyle</span> class using <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="StyleNew" data-popup-theme="ui-tooltip-green qtip-green">StyleNew</span> property and set its properties such as border style, direction and color. The grid control provides **BorderStyleEnum** as well as **BorderDirEnum** to set the border style and direction respectively.

Use the below code to change border of rows or columns of the WinForms FlexGrid.

```csharp
// Set the border style for first column
c1FlexGrid1.Cols[1].StyleNew.Border.Style = BorderStyleEnum.Groove;
c1FlexGrid1.Cols[1].StyleNew.Border.Color = Color.Red;
c1FlexGrid1.Cols[1].StyleNew.Border.Direction = BorderDirEnum.Vertical;
//Set the border style for first row
c1FlexGrid1.Rows[1].StyleNew.Border.Style = BorderStyleEnum.Raised;
c1FlexGrid1.Rows[1].StyleNew.Border.Color = Color.Blue;
```

```vbnet
' Set the border style for first column
c1FlexGrid1.Cols(1).StyleNew.Border.Style = BorderStyleEnum.Groove
c1FlexGrid1.Cols(1).StyleNew.Border.Color = Color.Red
c1FlexGrid1.Cols(1).StyleNew.Border.Direction = BorderDirEnum.Vertical
'Set the border style for first row
c1FlexGrid1.Rows(1).StyleNew.Border.Style = BorderStyleEnum.Raised
c1FlexGrid1.Rows(1).StyleNew.Border.Color = Color.Blue        
```

## Customize Cell Border

To customize border of every cell in the grid, you can access the built-in style "**Normal**" and set its border properties. Similarly, you can change the style of specific types of cells such fixed or frozen by accessing their corresponding styles from <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="Styles" data-popup-theme="ui-tooltip-green qtip-green">Styles</span> collection.

Below code lets you customize the border of normal cells of the WinForms FlexGrid.

```csharp
// Set the border style for all grid cells
c1FlexGrid1.Styles.Normal.Border.Style = BorderStyleEnum.Double; 
```

```vbnet
' Set the border style for all grid cells
c1FlexGrid1.Styles.Normal.Border.Style = BorderStyleEnum.Double    
```