Stores information about row sizes and provides methods for fast scrolling among millions of rows. The class only stores the sizes of rows which have been resized and uses additional structures to allow fast calculation of target state when scrolling with large amounts.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.GridView.dll
Syntax:
public class VirtualGridTableViewState : INotifyPropertyChanged
Inheritance: objectVirtualGridTableViewState
Implements:
Constructors
Initializes a new instance of the VirtualGridTableViewState class.
Properties
Gets a read only collection of all the items pinned at the bottom of the view.
public ReadOnlyCollection<int> BottomPinnedItems { get; }
Gets or sets the default size of items which have never been resized.
public int DefaultItemSize { get; set; }
Gets or sets a value indicating whether data is presented in chunks (pages) to the user.
public bool EnablePaging { get; set; }
Gets or sets the total number of items to be displayed.
public int ItemCount { get; set; }
Gets or sets the spacing between adjucent items.
public int ItemSpacing { get; set; }
Gets or sets the index of the page currently presented in the grid.
public int PageIndex { get; set; }
Gets or sets the number of rows shown per page when paging is enabled.
public int PageSize { get; set; }
Gets a value indicating whether paging is supported by this instance.
public bool SupportsPaging { get; }
Gets a read only collection of all the items pinned at the top of the view.
public ReadOnlyCollection<int> TopPinnedItems { get; }
Gets the total number of pages when paging is enabled.
public int TotalPages { get; }
Methods
Suspends calling UpdateOnItemSizeChanged()
public void BeginUpdate()
Fires when the DPI scaling is changed.
Resumes calling UpdateOnItemSizeChanged(), forces an update.
public void EndUpdate()
Gets the currently set size of an item with a given index. Checks if the item is pinned or expanded. Return 0 for pinned items and the total expanded size for expanded items.
public int GetItemSize(int itemIndex, bool checkPinned, bool checkExpanded)
The index of the item.
checkPinnedboolDetermines if an item should be considered pinned if it is pinned.
checkExpandedboolDetermines if an expanded row should include its child view size.
Returns:The size of the item.
Gets the currently set size of an item with a given index. Checks if the item is pinned or expanded. Return 0 for pinned items and the total expanded size for expanded items.
Returns a read-only collection of the sizes of the item.
public ReadOnlyCollection<KeyValuePair<int, int>> GetItemSizes()
ReadOnlyCollection<KeyValuePair<int, int>>
Returns a read-only collection of the sizes of the item.
Gets the pin position of the specified item.
public PinnedRowPosition GetPinPosition(int itemIndex)
The index of the item.
Returns:The pin position of the specified item.
Calculates and returns the scroller position and offset if scrolled down from the bottom of item [startIndex] with [scrollOffset].
public int GetScrollDownTarget(int startIndex, int scrollOffset, out int targetIndex)
The current item from the scroller (the scroll operation starts from the bottom of this item).
scrollOffsetintThe amount to scroll with.
targetIndexintReturns the index of the item which should be set as Current to the scroller.
Returns:Return the new scroll offset which should be set to the scroller after the Current has been set.
Calculates and returns the scroller position and offset if scrolled up from the bottom of item [startIndex] with [scrollOffset].
public int GetScrollUpTarget(int startIndex, int scrollOffset, out int targetIndex)
The current item from the scroller (the scroll operation starts from the bottom of this item).
scrollOffsetintThe amount to scroll with.
targetIndexintReturns the index of the item which should be set as Current to the scroller.
Returns:Return the new scroll offset which should be set to the scroller after the Current has been set.
Calculates the total size of all items, using the ItemCount, DefaultItemSize, ItemSpacing, and considering the resized items. Used to calculate the maximum for the scrollbar.
Fires the event.
protected virtual void OnPageIndexChanged()
Resets the collections with sized items.
public void Reset()
Resets the size of the item when it is expanded.
Sets the pin position of the specified item.
public void SetPinPosition(int itemIndex, PinnedRowPosition position)
The index of the item.
positionPinnedRowPositionThe pin position.
Updates the internal structures when the size of an item changes. Needed for proper calculations of scroll offsets. See the description of [partialItemSizes] and [itemSizes] for more info.
public void UpdateOnItemSizeChanged()
Events
Occurs after the page index changes.
public event EventHandler PageIndexChanged
Occurs before the page index changes.
public event VirtualGridPageChangingEventHandler PageIndexChanging
public event PropertyChangedEventHandler PropertyChanged
Implements: