AutoFill and Formulas in wpf GridControl, like in Excel

Hello,

I have just started using GridControl in a C# WPF application.

 1) Is there a feature, like in Excel called AutoFill, that automatically populates cells with data (text, numbers, dates, formulas) by recognizing patterns from initial entries, using the small green square (fill handle) at the corner of a selected cell to copy content over the range of cells.


2) I set all cells to CellType = "FormulaCell". However, when I start typing a formula beginning with = and then click another cell to reference it, the focus switches to that cell instead of inserting the reference (for example, =A1).


Please help.






6 Replies

SB Sweatha Bharathi Syncfusion Team December 18, 2025 12:10 PM UTC

Hi Vadim,


We have reviewed your query. In GridControl, there is no direct support for AutoFill and Formula Range Selection. However, this can be achieved by implementing custom classes such as GridFillSeriesMouseController and FormulaSupportWithRangeSelectionsHelper. We have provided samples for both implementations for your reference. Kindly review the samples. 

Additionally, we would like to inform you that we have a SpreadsheetControl that demonstrates Excel-like behavior without requiring these customizations or custom classes. It provides built-in support for AutoFill and formula functionality. For further reference, you can check the following User Guide (UG) link:



Regards,
Sweatha B

Attachment: Samples_871ea2ea.zip


VA Vadim December 20, 2025 06:47 PM UTC

Hello Sweatha,

Thank you for your prompt response.

I’m currently evaluating the SfSpreadsheet control, as it has features we want to use in our grid.

However, I encountered an issue with the Freeze Rows feature. I modified your demo project, “FreezeRowColumnDemo.” Each time I change the column parameter in FreezePanes() on a button click, the column that was previously frozen disappears from the spreadsheet grid.

Another question: is there a way to make cells non-editable within a specific range of rows while leaving the rest of the cells unchanged (editable)? I want to protect the header rows from being edited.

I found a way to do this by locking cells on a protected sheet. However, a warning dialog appears when a locked cell is clicked, and I need a custom action to occur when the header cells are clicked.


Also, what is the best way to control the number of rows/columns displayed in the grid? I want to limit the number of columns, and the user should not be able to add new columns. The rows should be added by using "+Add New Row"

   

Thank you


Attachment: freezeRev1_af1b308a.zip



SP Sreemon Premkumar Muthukrishnan Syncfusion Team December 22, 2025 01:18 PM UTC

Hi Vadim,

 

We were able to replicate the reported issue with the frozen columns and also understand your requirements regarding limiting and restricting the addition of rows and columns, as well as setting the header row as non‑editable. We are currently analyzing your requirement on our side. We will need some time to validate it and will provide you with an update on or before December 24, 2026.

 

We appreciate your patience until then.

 

In the meantime, regarding your requirement that “Rows should be added using ‘+Add New Row’”, could you please provide more details on how you expect the new rows to be added?


Regards,

Sreemon Premkumar M.



VA Vadim December 22, 2025 02:39 PM UTC

Hello Sreemon,

The idea behind the “add new line” feature and setting the title/ header block  rows as non‑editable is as follows

  1. The sheet starts with a formatted title block that represents the table’s multi-line headers ( the rows in this block must be non-editable. ), followed by one empty row for data input.
  2. If the user presses the Down Arrow key with the cursor positioned on the last available row, and that row is not empty, a new empty row appears in the grid.
  3. Is there a way to get the index of the last created row, or do I need to keep track of it manually?
  4. The idea it not to keep unnecessary empty rows.

Also few questions about the AutoFill :
  1. How to enable auto-scrolling when dragging a cell down or to the right by the bottom-right corner (AutoFill)?
  2. How to preserve the cell’s original formatting when using AutoFill or Copy/Paste?

Thank you,
Vadim


VA Vadim December 22, 2025 04:08 PM UTC

Hello Sreemon,


Attached please find the modified project and two screenshots.


Description of the problem:

  1. Using  FreezePanes
  2.  spreadSheetControl.Workbook.ActiveSheet.Range[9, 13].FreezePanes();

     var gridModel = spreadSheetControl.ActiveGrid;

     gridModel.FrozenRows = 9;

     gridModel.FrozenColumns = 13;

  3. Run the application and maximize the main window.
  4. Select a cell. The cell border selection appears.
  5. Shrink the main window horizontally over the Freeze Panes area (covering the last frozen column)
  6. The cell selection disappears and cells can't be selected anymore.
  7. The same behavior can also be reproduced by setting spreadSheetControl.DefaultColumnCount = 12 (in this particular case).
Regards,
Vadim


Attachment: freezeRev2_bcc1232f.zip




SB Sweatha Bharathi Syncfusion Team December 23, 2025 05:23 AM UTC

Vadim,

We have created a new forum for Spreadsheet related query. We request that you have a further follow-up on a below forum.


Loader.
Up arrow icon