protected void btnApplyBorderStyles_Click(object sender, EventArgs e)
{
// ExStart:ApplyBorderStyles
// Accessing the reference of the worksheet that is currently active and resize first row and column
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];
sheet.Cells.Clear();
sheet.Cells.SetColumnWidth(0, 50);
sheet.Cells.SetRowHeight(0, 40);
// Accessing a specific cell of the worksheet
GridCell cell = sheet.Cells["A1"];
var style = cell.Style;
// Setting the border style, width and color
style.BorderStyle = BorderStyle.Solid;
style.BorderWidth = new Unit(2, UnitType.Pixel);
style.BorderColor = Color.Blue;
// Set the cell style
cell.CopyStyle(style);
// ExEnd:ApplyBorderStyles
}