Aspose.Cells.GridWeb.Examples.CSharp.RowsAndColumns.CopyRowsColumns.btnCopyRow_Click C# (CSharp) Method

btnCopyRow_Click() protected method

protected btnCopyRow_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        protected void btnCopyRow_Click(object sender, EventArgs e)
        {
            // Set sheets selectedIndex to 0
            GridWeb1.WorkSheets.ActiveSheetIndex = 0;

            // ExStart:CopyRow
            // Get the instance of active GridWorksheet
            var activeSheet = GridWeb1.ActiveSheet;

            // Copy first row to next row
            activeSheet.Cells.CopyRow(activeSheet.Cells, 0, 1);

            Label1.Text = "Row 1 copied to row 2 in worksheet " + activeSheet.Name;
            // ExEnd:CopyRow
        }