Aspose.Cells.GridWeb.Examples.CSharp.RowsAndColumns.CustomizeHeaders.btnCreateCaption_Click C# (CSharp) Method

btnCreateCaption_Click() protected method

protected btnCreateCaption_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        protected void btnCreateCaption_Click(object sender, EventArgs e)
        {        
            CreateRowCaptions();
            CreateColumnCaptions();

            // Accessing the worksheet that is currently active
            GridWorksheet workSheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            // Adjusts column width.
            GridCells cells = workSheet.Cells;
            cells.SetColumnWidth(0, 20);
            cells.SetColumnWidth(1, 20);
            cells.SetColumnWidth(2, 20);
        }