{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class GridView | App UI | 0.5.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GridView

    A view containing recycled rows with items inside.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BindableElement
    GridView
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IBindable
    ISerializationCallbackReceiver
    Inherited Members
    BindableElement.binding
    BindableElement.bindingPath
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Assembly: solution.dll
    Syntax
    public class GridView : BindableElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable, ISerializationCallbackReceiver

    Constructors

    Name Description
    GridView()

    Creates a GridView with all default properties. The itemsSource, itemHeight, makeItem and bindItem properties must all be set for the GridView to function properly.

    GridView(IList, Func<VisualElement>, Action<VisualElement, int>)

    Constructs a GridView, with all required properties provided.

    Fields

    Name Description
    ussClassName

    The USS class name for GridView elements.

    Properties

    Name Description
    allowNoSelection

    Whether the GridView allows to have no selection when the selection type is Single or Multiple.

    bindItem

    Callback for binding a data item to the visual element.

    columnCount

    The number of columns for this grid.

    contentContainer

    Returns the content container for the GridView. Because the GridView control automatically manages its content, this always returns null.

    dragger

    The Dragger manipulator used by this GridView.

    isSelecting

    Returns true if the soft-selection is in progress.

    itemHeight

    The height of a single item in the list, in pixels.

    itemWidth
    itemsSource

    The data source for list items.

    makeItem

    Callback for constructing the VisualElement that is the template for each recycled and re-bound element in the list.

    operationMask

    A mask describing available operations in this GridView when the user interacts with it.

    preventScrollWithModifiers

    Prevents the grid view from scrolling when the user presses a modifier key at the same time as scrolling.

    resolvedItemHeight

    The computed pixel-aligned height for the list elements.

    resolvedItemWidth
    scrollView

    The ScrollView used by the GridView.

    selectedIds

    Returns the IDs of selected items in the data source. Always returns an enumerable, even if no item is selected, or a single item is selected.

    selectedIndex

    Returns or sets the selected item's index in the data source. If multiple items are selected, returns the first selected item's index. If multiple items are provided, sets them all as selected.

    selectedIndices

    Returns the indices of selected items in the data source. Always returns an enumerable, even if no item is selected, or a single item is selected.

    selectedItem

    Returns the selected item from the data source. If multiple items are selected, returns the first selected item.

    selectedItems

    Returns the selected items from the data source. Always returns an enumerable, even if no item is selected, or a single item is selected.

    selectionType

    Controls the selection type.

    showBorder

    Enable this property to display a border around the GridView.

    unbindItem

    Callback for unbinding a data item from the VisualElement.

    Methods

    Name Description
    AddToSelection(int)

    Adds an item to the collection of selected items.

    CancelDrag()

    Cancel drag operation.

    ClearSelection()

    Deselects any selected items.

    ClearSelectionWithoutNotify()
    GetIndexByWorldPosition(Vector2)

    Returns the index of the item at the given position.

    Refresh()

    Clears the GridView, recreates all visible visual elements, and rebinds all items.

    RemoveFromSelection(int)

    Removes an item from the collection of selected items.

    ScrollToItem(int)

    Scrolls to a specific item index and makes it visible.

    SetSelection(IEnumerable<int>)

    Sets a collection of selected items.

    SetSelection(int)

    Sets the currently selected item.

    SetSelectionWithoutNotify(IEnumerable<int>)

    Sets a collection of selected items without triggering a selection change callback.

    Events

    Name Description
    contextClicked

    Callback triggered when the user right-clicks on an item.

    doubleClicked

    Callback triggered when the user double-clicks on an item.

    dragCanceled

    Callback triggered when drag has been canceled.

    dragFinished

    Callback triggered when drag has finished.

    dragStarted

    Callback triggered when drag has started.

    dragUpdated

    Callback triggered when items are dragged.

    itemsChosen

    Callback triggered when the user acts on a selection of one or more items, for example by double-clicking or pressing Enter.

    selectedIndicesChanged

    Callback triggered when the selection changes.

    selectionChanged

    Callback triggered when the selection changes.

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContext(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.GetWorldBoundingBox(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, PopoverPlacement)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)