Aspose.Cells.GridWeb.Examples.CSharp.RowsAndColumns.ResizeRowsColumns.btnSetColumnWidth_Click C# (CSharp) Метод

btnSetColumnWidth_Click() защищенный Метод

protected btnSetColumnWidth_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void
        protected void btnSetColumnWidth_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                // ExStart:SetColumnWidth
                // Get column index entered by user 
                int columnIndex = Convert.ToInt16(txtColumnIndex.Text.Trim());

                // Get column width entered by user
                int columnWidth = Convert.ToInt16(txtColumnWidth.Text.Trim());

                // Accessing the cells collection of the worksheet that is currently active
                GridCells cells = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex].Cells;

                // Resize column at specified index to specified width
                cells.SetColumnWidth(columnIndex, columnWidth);         
                // ExEnd:SetColumnWidth
            }            
        }