SelectionChanged by program

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

  • Posted 8 September 2017, 2:57 pm EST

    Hello,

    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 :

    sheet.OperationMode = OperationMode.ExtendedSelect;
    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 ?

     

    thks

    dt 

     

  • 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

    Nice!

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

     I founded declaration of handler on this page :

    http://www.gcpowertools.com/help/spreadnet6/WF/FarPoint.Win.Spread~FarPoint.Win.Spread.Model.SheetSelectionModelEventHandler.html 

    thanks a lot!

    DT

Need extra support?

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

Learn More

Forum Channels