src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/Provider/ProviderEvents.cs
/// <summary>
///     Store positions to track. Generally called from an BeforeListShuffle event
/// </summary>
/// <param name="positions">An array of PositionTracker structures</param>
/// <param name="key">The key for the tracked positions. Usually the instance of the object tracking positions.</param>
/// <param name="multiColumnPositions">Specify if the positions use multi or single column indices. Note that this value can be different in the RetrievePositions call.</param>
Store positions to track. Generally called from an BeforeListShuffle event
Store positions to track . Generally called from an BeforeListShuffle event
public void StorePositions(PositionTracker[] positions, object key, bool multiColumnPositions)
        {
            if (positions != null)
            {
                if (myMultiColumnTree != null)
                {
                    int i;
                    int startRow;
                    var rowBound = (myMultiColumnTree as ITree).VisibleItemCount;
                    var positionsCount = positions.Length;
                    if (multiColumnPositions)
                    {
                        for (i = 0; i < positionsCount; ++i)
                        {
                            if (positions[i].Column == -1)
                            {
                                startRow = positions[i].StartRow;
                                if (startRow != -1
                                    && startRow < rowBound)
                                {
                                    positions[i].Column = myMultiColumnTree.FindFirstNonBlankColumn(startRow);
                                }
                            }
                        }
                    }
                    else
                    {
                        for (i = 0; i < positionsCount; ++i)
                        {
                            startRow = positions[i].StartRow;
                            if (startRow != -1
                                && startRow < rowBound)
                            {
                                positions[i].StartRow = myMultiColumnTree.TranslateSingleColumnRow(startRow);
                                positions[i].Column = 0; 
                            }
                        }
                    }
                }
                myTable[key] = positions;
            }
        }
public void StorePositions ( PositionTracker [ ] positions , object key , bool multiColumnPositions ) { if ( positions != null ) { if ( myMultiColumnTree != null ) { int i ; int startRow ; var rowBound = ( myMultiColumnTree as ITree ) . VisibleItemCount ; var positionsCount = positions . Length ; if ( multiColumnPositions ) { for ( i = 0 ; i < positionsCount ; ++ i ) { if ( positions [ i ] . Column == - 1 ) { startRow = positions [ i ] . StartRow ; if ( startRow != - 1 && startRow < rowBound ) { positions [ i ] . Column = myMultiColumnTree . FindFirstNonBlankColumn ( startRow ) ; } } } } else { for ( i = 0 ; i < positionsCount ; ++ i ) { startRow = positions [ i ] . StartRow ; if ( startRow != - 1 && startRow < rowBound ) { positions [ i ] . StartRow = myMultiColumnTree . TranslateSingleColumnRow ( startRow ) ; positions [ i ] . Column = 0 ; } } } } myTable [ key ] = positions ; } }
Store positions to track.
Store positions to track .
// Translate from single column positions into multicolumn indices when // we store the data, then translate back if needed on the way out. Feeding // the position tracking algorithms in the core engine consistent data is well // worth the up front translation cost. // Find any items with a column of 'I don't care' and // bind it to the first possible column. // Ignore NoColumnAffinity setting, this will always bind correctly
positions
PositionTracker[]
An array of PositionTracker structures
An array of PositionTracker structures
key
object
The key for the tracked positions. Usually the instance of the object tracking positions.
The key for the tracked positions . Usually the instance of the object tracking positions .
multiColumnPositions
bool
Specify if the positions use multi or single column indices. Note that this value can be different in the RetrievePositions call.
Specify if the positions use multi or single column indices . Note that this value can be different in the RetrievePositions call .