Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
Finding the REAL Row Index
posted

OK Folks ... lots of power in the infragistics grid, but I need some help on what "should" be an easy problem.  I need the REAL index of the row in the list.  This index sits independent of any column sort or row pin.  There must be a row property that is storing this index location as I can pin a row, its index changes to 0, I then unpin it and it returns to its original location.  I have tried different combinations of the following:

Index

ListIndex

VisibleIndex

But NONE of these 3 properties is actually referencing the real row index for display.  So where would I find that row property? 

Thanks for any feedback you may have!

Parents
No Data
Reply
  • 48586
    posted

    Hello,

     

    When you unpin a row, UltraGrid finds the position of the unpinned row, in order to placed it on the correct position in the visible rows collection.  So if you pin a row, then re-sort or re-filter some column and unpin the row, UltraGrid  placed the unpinned row in the correct position.

     

    So if the Index, ListIndex, VisibleIndex properties doesn’t works for you:

     

    Index The index of this row in its parent collection  

     

    ListIndex Returns the index corresponding to this row from the IList that the control is bound to. Return value of -1 indicates that a row has been deleted or doesn't exist anymore.  

     

    VisibleIndex Returns the index of this row in its parent collection, relative to all other visible rows. Hidden rows are not counted.  

     

    You could handle BeforeRowFixedStateChanged event of UltraGrid and to get the index of the row, which fixed property will be changed (use e.Row in this event), in order to get the index of the row before  it is pinned. But you should keep in mind that if customer re-sort or re-filter the grid, when a pinned row is unpinned , this row could be placed on a position different of this before it was pinned.

     

    Please let me know if you have any further questions.

Children