DragFill not working

Posted by: geert on 8 September 2017, 2:39 pm EST

  • Posted 8 September 2017, 2:39 pm EST


    I'm using version 5.0.3514.2008 of the spread and I want to allow dragfill functionality to the spread. When I want to dragg the content of the selected cells to the cells below, the spread only moves the last selected value.

    See the attachment.

    This is my code to initialize the spread (sheet).

    fpSpread1.InterfaceRenderer = null;
    fpSpread1.ActiveSheet.GrayAreaBackColor =
    Color.FromArgb(227, 239, 255);
    fpSpread1.ActiveSheet.RowHeader.Visible =
    fpSpread1.TabStripInsertTab =
    fpSpread1.TabStrip.ButtonPolicy = FarPoint.Win.Spread.
    fpSpread1.ActiveSheet.ColumnCount = 100;
    fpSpread1.ActiveSheet.RowCount = 5000;
    StyleInfo si = new FarPoint.Win.Spread.StyleInfo();
    si.Font =
    new Font("Arial", 9);
    fpSpread1.ActiveSheet.DefaultStyle = si;
    fpSpread1.ActiveSheet.SerializeModels =
    fpSpread1.ActiveSheet.SelectionUnit =
    fpSpread1.AllowDragFill =
    fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.
    EnhancedColumnHeaderRenderer ecr = new FarPoint.Win.Spread.CellType.EnhancedColumnHeaderRenderer();
    ecr.WordWrap =
    fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Renderer = ecr;

    FarPoint.Win.Spread.CellType.TextCellType textCell = new FarPoint.Win.Spread.CellType.TextCellType();

    foreach (Column c in fpSpread1.ActiveSheet.Columns)
    c.CellType = textCell;


  • Replied 8 September 2017, 2:39 pm EST


    It works at my end, I am using the latest build for Spread 5(5.0.3518.2008). I select a group of cells and dragged it to next few cells. The cell content is dragged to other cells. For example if I have

    A       B      C

    1        2      3

    2        4      5

    4        7      6

    if I select first three rows in first column(1,2,4) and drag down to  one cell , only 1 is dragged and 2, 4 not. If I dragged to next three rows in the same column then all the three selected values are dragged.I have attached working sample please test this behavior and let me know if you face any issues.




  • Replied 8 September 2017, 2:39 pm EST

    I get an error while converting this solution to Visual Studio 2010. Can you create this sample in VS 2010 instead?
  • Replied 8 September 2017, 2:39 pm EST


    I have created a sample project with VS2010 using the code provided by you.Please test the attached sample and let me know if you still face any issues.




  • Replied 8 September 2017, 2:39 pm EST

    This is working!
    I'm trying to find the difference between your spread object and mine.

    I let you know if I can find it.

  • Replied 8 September 2017, 2:39 pm EST


     I found the reason why the dragfill didn't work. I also have the event CellClick defined in my project with this code what was causing the problem:

     this.fpSpread1.ActiveSheet.ActiveRowIndex = e.Row;
    this.fpSpread1.ActiveSheet.AddSelection(e.Row, 0, 1, fpSpread1.ActiveSheet.ColumnCount);

    When i put this code into comment, the dragfill works fine!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels