ClassVirtualGridTableViewState
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
VirtualGridTableViewState(int, int, int, bool)
Initializes a new instance of the VirtualGridTableViewState class.
Properties
BottomPinnedItems
Gets a read only collection of all the items pinned at the bottom of the view.
Declaration
public ReadOnlyCollection<int> BottomPinnedItems { get; }
Property Value
DefaultItemSize
Gets or sets the default size of items which have never been resized.
DpiScale
Gets the current DPI scale factor.
EnablePaging
Gets or sets a value indicating whether data is presented in chunks (pages) to the user.
ItemCount
Gets or sets the total number of items to be displayed.
ItemSpacing
Gets or sets the spacing between adjucent items.
PageIndex
Gets or sets the index of the page currently presented in the grid.
PageSize
Gets or sets the number of rows shown per page when paging is enabled.
SupportsPaging
Gets a value indicating whether paging is supported by this instance.
TopPinnedItems
Gets a read only collection of all the items pinned at the top of the view.
Declaration
public ReadOnlyCollection<int> TopPinnedItems { get; }
Property Value
TotalPages
Gets the total number of pages when paging is enabled.
Methods
BeginUpdate()
Suspends calling UpdateOnItemSizeChanged()
Declaration
public void BeginUpdate()
DpiScaleChanged(SizeF)
Fires when the DPI scaling is changed.
Declaration
public virtual void DpiScaleChanged(SizeF scale)
Parameters
scale
The scale.
EndUpdate()
Resumes calling UpdateOnItemSizeChanged(), forces an update.
Declaration
public void EndUpdate()
GetItemOffset(int)
Gets the total offset from the beginning of the items to the top edge of the specified item. The method does not consider if paging is enabled.
GetItemScrollOffset(int)
Gets the scroll offset from the beginning of the items in the current view to the top edge of the specified item. The method considers if paging is enabled.
GetItemSize(int)
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.
GetItemSize(int, bool)
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.
GetItemSize(int, bool, bool)
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.
Declaration
public int GetItemSize(int itemIndex, bool checkPinned, bool checkExpanded)
Parameters
itemIndex
The index of the item.
checkPinned
Determines if an item should be considered pinned if it is pinned.
checkExpanded
Determines if an expanded row should include its child view size.
Returns
The size of the item.
GetItemSizes()
Returns a read-only collection of the sizes of the item.
Declaration
public ReadOnlyCollection<KeyValuePair<int, int>> GetItemSizes()
Returns
ReadOnlyCollection<KeyValuePair<int, int>>
Returns a read-only collection of the sizes of the item.
GetPinPosition(int)
Gets the pin position of the specified item.
Declaration
public PinnedRowPosition GetPinPosition(int itemIndex)
Parameters
itemIndex
The index of the item.
Returns
The pin position of the specified item.
GetScrollDownTarget(int, int, out int)
Calculates and returns the scroller position and offset if scrolled down from the bottom of item [startIndex] with [scrollOffset].
Declaration
public int GetScrollDownTarget(int startIndex, int scrollOffset, out int targetIndex)
Parameters
startIndex
The current item from the scroller (the scroll operation starts from the bottom of this item).
scrollOffset
The amount to scroll with.
targetIndex
Returns 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.
GetScrollUpTarget(int, int, out int)
Calculates and returns the scroller position and offset if scrolled up from the bottom of item [startIndex] with [scrollOffset].
Declaration
public int GetScrollUpTarget(int startIndex, int scrollOffset, out int targetIndex)
Parameters
startIndex
The current item from the scroller (the scroll operation starts from the bottom of this item).
scrollOffset
The amount to scroll with.
targetIndex
Returns 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.
GetTotalItemSize()
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.
IsPinned(int)
Determines whether the item at the specified index is pinned.
OnPageIndexChanged()
Fires the event.
Declaration
protected virtual void OnPageIndexChanged()
OnPageIndexChanging(int, int)
Fires the event.
OnPropertyChanged(string)
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyName
ResetExpandedSize(int)
Resets the size of the item when it is expanded.
Declaration
public void ResetExpandedSize(int itemIndex)
Parameters
itemIndex
The index of the item.
SetExpandedSize(int, int)
Sets the size of the item when it is expanded.
SetItemSize(int, int)
Sets a custom size to the item with a given index.
SetPinPosition(int, PinnedRowPosition)
Sets the pin position of the specified item.
Declaration
public void SetPinPosition(int itemIndex, PinnedRowPosition position)
Parameters
itemIndex
The index of the item.
position
The pin position.
UpdateOnItemSizeChanged()
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.
Declaration
public void UpdateOnItemSizeChanged()
Events
PageIndexChanged
Occurs after the page index changes.
PageIndexChanging
Occurs before the page index changes.
Declaration
public event VirtualGridPageChangingEventHandler PageIndexChanging
Event Value
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements