Articles in this section
Category / Section

How to disable fill and copy series in WinForms Spreadsheet?

1 min read

The Windows Forms Spreadsheet has the built-in support for fill across the row or column cells by dragging the fill handle into the cell containing value or any formula within it. If you want to disable the fill and copy series in spreadsheet, you can set the AllowFillSeries property of FillSeriesController to false in WorkbookLoaded event.

Refer the below code for your reference.

C#

//To disable fill series
this.spreadsheet.WorkbookLoaded += Spreadsheet_WorkbookLoaded;
 
private void Spreadsheet_WorkbookLoaded(object sender, Syncfusion.Windows.Forms.Spreadsheet.Helpers.WorkbookLoadedEventArgs args)
{
    foreach(var sheet in args.GridCollection)
    {
        sheet.FillSeriesController.AllowFillSeries = false;
    }
}

If you want to disable the fill and copy series in newly added spreadsheet at run time, you can set the AllowFillSeries property of FillSeriesController to false in WorksheetAdded event.

Refer the below code for your reference.

C#

this.spreadsheet.WorksheetAdded += Spreadsheet_WorksheetAdded;
 
private void Spreadsheet_WorksheetAdded(object sender, Syncfusion.Windows.Forms.Spreadsheet.Helpers.WorksheetAddedEventArgs args)
{
    spreadsheet.ActiveGrid.FillSeriesController.AllowFillSeries = false;
}

Below is the screen shot when AllowFillSeries is false.

Disable the copy and fill series in spreadsheet

Below the screen shot when AllowFillSeries is true.

Enable the copy and fill series in spreadsheet

Sample: View sample in GitHub.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied