Hierarchical vs Sort grid

Posted by: david on 1 February 2018, 5:54 am EST

    • Post Options:
    • Link

    Posted 1 February 2018, 5:54 am EST

    Hello,

    I use hierarchical grid and when I click on child view rowI would like know parent row Index.

    I use

    e.SheetView.ParentRowIndex
    in ```

    grd_ChildViewCreated

    It' works fine. But if I sort (master) grid by clicking on arrow in header column my grid is sorted but ParentRowIndex doesn't refresh.
    
    An example to explain : 
    1° I have 10 master rows on my grid
    2° I click on "+" on row 10. then Parent RowIndex = 9  (on ```
    grd_ChildViewCreated
    ``` event)
    
    Now I reload grid (because child view created event as already fired).
    
    3° I clik on header column to sort my grid
    My row 10 (index =9) goes on index 6.
    4° I click on "+" on row index 6. then Parent RowIndex always equal 9  (on ```
    grd_ChildViewCreated
    ``` event)
  • Posted 2 February 2018, 3:07 am EST

    Hello,

    Using following lines of code to get parent row index after sorting

    private void FpSpread1_ChildViewCreated(object sender, FarPoint.Win.Spread.ChildViewCreatedEventArgs e)

    {

    FarPoint.Win.Spread.FpSpread sp = sender as FarPoint.Win.Spread.FpSpread;

    sp.ActiveSheet.GetViewRowFromModelRow(e.SheetView.ParentRowIndex);

    }

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels