SelectionChanged by program

Posted by: sgmicro on 8 September 2017, 2:57 pm EST

  • Posted 8 September 2017, 2:57 pm EST


    the event SelectionChanged  doesn't not fire when I select a row by program. I saw on this forum that I can use 'DefaultSheetSelectionModel' but I don't understand how...


     Here my source code to select a row

    Spread  Initialization :

    <span class="Apple-tab-span" style="white-space:pre;"> </span>sheet.OperationMode = OperationMode.ExtendedSelect;
    <span class="Apple-tab-span" style="white-space:pre;"> </span>sheet.SelectionUnit = SelectionUnit.Row;


     Select Row method:

    SheetView sheet = grid.ActiveSheet;
    sheet.SetActiveCell(row, column);
    sheet.Models.Selection.SetSelection(row, column, rowCount, columnCount);
    if (showActiveCell)
      grid.ShowActiveCell(VerticalPosition.Center, HorizontalPosition.Center); 


     how can I fire event SelectionChanged ?





  • Replied 8 September 2017, 2:57 pm EST

    Here is some code from the help file demonstrating it.

    private void menuItem23_Click(object sender, System.EventArgs e)
    model = (FarPoint.Win.Spread.Model.BaseSheetSelectionModel)fpSpread1.ActiveSheet.Models.Selection;
    model.SetSelection(0, 0, 3, 3);
    private void fpSpread1_SelectionModelChanged(object sender, FarPoint.Win.Spread.Model.SheetSelectionModelEventArgs e)
    listBox1.Items.Add("Changed Event Fired");

  • Replied 8 September 2017, 2:57 pm EST


    I met some difficulties to declare Handler. I complete your response to help other people,

     I founded declaration of handler on this page : 

    thanks a lot!


Need extra support?

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

Learn More

Forum Channels