Highlight row in a Spread grid on a form that is NOT the topmost form

Posted by: imgodot on 22 March 2018, 4:03 am EST

    • Post Options:
    • Link

    Posted 22 March 2018, 4:03 am EST

    We have two MDI child forms.

    Both forms have grids that display the same data.

    The grids are both bound to the same BindingSource.

    The OperationSelectionMode is set to SingleSelect on both grids.

    Clicking on a grid row in either grid shows the standard dark blue selection background color.

    What we want to happen is, when a row is selected in the grid in the topmost form, the same row in the grid on the OTHER form should be highlighted as well.

    HOWEVER, we cannot get the grid row in the “background” form to highlight.

    We use AddSelection() to set the selection to no avail.

    If we also call Spread.Focus() for the grid on the “background” form, we see the correct row gets a dotted-line selection rectangle around it but the background color for the row does not get set.

    How can we get the standard row highlight to display in the grid in the “background” form?

    Thanks.

    – Paul

  • Posted 26 March 2018, 2:30 am EST

    Hi Paul,

    We are currently working on this issue, soon will get back to you.

    Thanks,

    Deepak Sharma

  • Posted 26 March 2018, 7:55 pm EST

    Hello,

    It seems you want to change the active row selection in child form as per the selected row in parent form. For this you can check the newly selected row for parent form Spread and set the same as activerow for child form Spread control. You can do that in SelectionChanged event of parent form Spread. For example:

    
     private void fpSpread1_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e)
            {
                FarPoint.Win.Spread.Model.CellRange cr;
                cr = e.Range;
                selectedRow = cr.Row;
                //Form2 is the child form
                FarPoint.Win.Spread.FpSpread childFormSpread = (FarPoint.Win.Spread.FpSpread)((Form2)Application.OpenForms["Form2"]).Controls[0];           
                childFormSpread.ActiveSheet.ActiveRowIndex = selectedRow;
                childFormSpread.ActiveSheet.AddSelection(selectedRow, 0, 1, childFormSpread.ActiveSheet.ColumnCount);
            }    
    

    Please refer to the attached sample application for implementation.

    Thanks,

    Deepak SharmaSpreadWinSelectRowChildForm.zip

Need extra support?

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

Learn More

Forum Channels