# Grid class

Namespace: [Eto.Forms](https://eto.picoe.ca/api/namespace/eto.forms.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
[ContentProperty("Columns")]
public abstract class Grid : Control, ISelectable<object>
```

Base grid control to display items in columns and rows

**Derived types:** [GridView](https://eto.picoe.ca/api/type/eto.forms.gridview.md), [TreeGridView](https://eto.picoe.ca/api/type/eto.forms.treegridview.md)

## Constructors

- [Grid](https://eto.picoe.ca/api/type/eto.forms.grid/ctor.md): (2 overloads) Initializes a new instance of the [Grid](https://eto.picoe.ca/api/type/eto.forms.grid.md) class.

## Fields

- [CellClickEvent](https://eto.picoe.ca/api/type/eto.forms.grid/cellclickevent.md): (static) Event identifier for the [Grid.CellClick](https://eto.picoe.ca/api/type/eto.forms.grid/cellclick.md) event.
- [CellDoubleClickEvent](https://eto.picoe.ca/api/type/eto.forms.grid/celldoubleclickevent.md): (static) Event identifier for the [Grid.CellDoubleClick](https://eto.picoe.ca/api/type/eto.forms.grid/celldoubleclick.md) event.
- [CellEditedEvent](https://eto.picoe.ca/api/type/eto.forms.grid/celleditedevent.md): (static) Event identifier for handlers when attaching the [Grid.CellEdited](https://eto.picoe.ca/api/type/eto.forms.grid/celledited.md) event
- [CellEditingEvent](https://eto.picoe.ca/api/type/eto.forms.grid/celleditingevent.md): (static) Event identifier for handlers when attaching the [Grid.CellEditing](https://eto.picoe.ca/api/type/eto.forms.grid/cellediting.md) event
- [CellFormattingEvent](https://eto.picoe.ca/api/type/eto.forms.grid/cellformattingevent.md): (static) Event identifier for handlers when attaching the [Grid.CellFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/cellformatting.md) event
- [ColumnHeaderClickEvent](https://eto.picoe.ca/api/type/eto.forms.grid/columnheaderclickevent.md): (static) Event identifier for handlers when attaching the [Grid.ColumnHeaderClick](https://eto.picoe.ca/api/type/eto.forms.grid/columnheaderclick.md) event
- [ColumnOrderChangedEvent](https://eto.picoe.ca/api/type/eto.forms.grid/columnorderchangedevent.md): (static) Event identifier for handlers when attaching the [Grid.ColumnOrderChanged](https://eto.picoe.ca/api/type/eto.forms.grid/columnorderchanged.md) event
- [ColumnWidthChangedEvent](https://eto.picoe.ca/api/type/eto.forms.grid/columnwidthchangedevent.md): (static) Event identifier for handlers when attaching the [Grid.ColumnWidthChanged](https://eto.picoe.ca/api/type/eto.forms.grid/columnwidthchanged.md) event
- [RowFormattingEvent](https://eto.picoe.ca/api/type/eto.forms.grid/rowformattingevent.md): (static) Event identifier for handlers when attaching the [Grid.RowFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/rowformatting.md) event
- [SelectionChangedEvent](https://eto.picoe.ca/api/type/eto.forms.grid/selectionchangedevent.md): (static) Event identifier for handlers when attaching the [Grid.SelectionChanged](https://eto.picoe.ca/api/type/eto.forms.grid/selectionchanged.md) event

## Properties

- [AllowColumnReordering](https://eto.picoe.ca/api/type/eto.forms.grid/allowcolumnreordering.md): Gets or sets a value indicating whether the user can re-order columns
- [AllowEmptySelection](https://eto.picoe.ca/api/type/eto.forms.grid/allowemptyselection.md): Gets or sets a value indicating that the user can clear the selection.
- [AllowMultipleSelection](https://eto.picoe.ca/api/type/eto.forms.grid/allowmultipleselection.md): Gets or sets a value indicating whether the user can select multiple rows
- [Border](https://eto.picoe.ca/api/type/eto.forms.grid/border.md): Gets or sets the border type
- [Columns](https://eto.picoe.ca/api/type/eto.forms.grid/columns.md): Gets the collection of columns to display in the grid
- [GridLines](https://eto.picoe.ca/api/type/eto.forms.grid/gridlines.md): Gets or sets the style of grid lines to show between columns and rows
- [IsEditing](https://eto.picoe.ca/api/type/eto.forms.grid/isediting.md): Gets a value indicating that the current cell is in edit mode.
- [RowHeight](https://eto.picoe.ca/api/type/eto.forms.grid/rowheight.md): Gets or sets the height for each row in the grid
- [SelectedItem](https://eto.picoe.ca/api/type/eto.forms.grid/selecteditem.md): If there is exactly one selected item, returns it, otherwise returns null.
- [SelectedItemBinding](https://eto.picoe.ca/api/type/eto.forms.grid/selecteditembinding.md): Gets a binding object to bind to the [Grid.SelectedItem](https://eto.picoe.ca/api/type/eto.forms.grid/selecteditem.md) property.
- [SelectedItems](https://eto.picoe.ca/api/type/eto.forms.grid/selecteditems.md): Gets an enumeration of the currently selected items
- [SelectedRow](https://eto.picoe.ca/api/type/eto.forms.grid/selectedrow.md): Gets or sets the selected row, or -1 for none.
- [SelectedRows](https://eto.picoe.ca/api/type/eto.forms.grid/selectedrows.md): Gets or sets the selected rows indexes
- [ShowHeader](https://eto.picoe.ca/api/type/eto.forms.grid/showheader.md): Gets or sets a value indicating that the header should be shown

## Methods

- [BeginEdit](https://eto.picoe.ca/api/type/eto.forms.grid/beginedit.md): Begin to edit one cell
- [CancelEdit](https://eto.picoe.ca/api/type/eto.forms.grid/canceledit.md): Cancels the current edit operation and reverts the cell value to the value in the model.
- [CommitEdit](https://eto.picoe.ca/api/type/eto.forms.grid/commitedit.md): Commits a current edit operation and sets the current value to the model.
- [GetCallback](https://eto.picoe.ca/api/type/eto.forms.grid/getcallback.md): Gets an instance of an object used to perform callbacks to the widget from handler implementations
- [OnCellClick](https://eto.picoe.ca/api/type/eto.forms.grid/oncellclick.md): Raises the [Grid.CellClick](https://eto.picoe.ca/api/type/eto.forms.grid/cellclick.md) event.
- [OnCellDoubleClick](https://eto.picoe.ca/api/type/eto.forms.grid/oncelldoubleclick.md): Raises the [Grid.CellDoubleClick](https://eto.picoe.ca/api/type/eto.forms.grid/celldoubleclick.md) event.
- [OnCellEdited](https://eto.picoe.ca/api/type/eto.forms.grid/oncelledited.md): Raises the [Grid.CellEdited](https://eto.picoe.ca/api/type/eto.forms.grid/celledited.md) event
- [OnCellEditing](https://eto.picoe.ca/api/type/eto.forms.grid/oncellediting.md): Raises the [Grid.CellEditing](https://eto.picoe.ca/api/type/eto.forms.grid/cellediting.md) event
- [OnCellFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/oncellformatting.md): Raises the [Grid.CellFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/cellformatting.md) event
- [OnColumnHeaderClick](https://eto.picoe.ca/api/type/eto.forms.grid/oncolumnheaderclick.md): Raises the [Grid.ColumnHeaderClick](https://eto.picoe.ca/api/type/eto.forms.grid/columnheaderclick.md) event
- [OnColumnOrderChanged](https://eto.picoe.ca/api/type/eto.forms.grid/oncolumnorderchanged.md): Raises the [Grid.ColumnOrderChanged](https://eto.picoe.ca/api/type/eto.forms.grid/columnorderchanged.md) event
- [OnColumnWidthChanged](https://eto.picoe.ca/api/type/eto.forms.grid/oncolumnwidthchanged.md): Raises the [Grid.ColumnWidthChanged](https://eto.picoe.ca/api/type/eto.forms.grid/columnwidthchanged.md) event
- [OnRowFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/onrowformatting.md): Raises the [Grid.CellFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/cellformatting.md) event
- [OnSelectionChanged](https://eto.picoe.ca/api/type/eto.forms.grid/onselectionchanged.md): Raises the [Grid.SelectionChanged](https://eto.picoe.ca/api/type/eto.forms.grid/selectionchanged.md) event
- [ScrollToRow](https://eto.picoe.ca/api/type/eto.forms.grid/scrolltorow.md): Scrolls to show the specified row in the view
- [SelectAll](https://eto.picoe.ca/api/type/eto.forms.grid/selectall.md): Selects all rows
- [SelectRow](https://eto.picoe.ca/api/type/eto.forms.grid/selectrow.md): Selects the row to the specified `row`, clearing other selections
- [UnselectAll](https://eto.picoe.ca/api/type/eto.forms.grid/unselectall.md): Clears the selection
- [UnselectRow](https://eto.picoe.ca/api/type/eto.forms.grid/unselectrow.md): Unselects the specified `row`

## Events

- [CellClick](https://eto.picoe.ca/api/type/eto.forms.grid/cellclick.md): Occurs when an individual cell is clicked.
- [CellDoubleClick](https://eto.picoe.ca/api/type/eto.forms.grid/celldoubleclick.md): Occurs when an individual cell is double clicked.
- [CellEdited](https://eto.picoe.ca/api/type/eto.forms.grid/celledited.md): Occurs after a cell has been edited
- [CellEditing](https://eto.picoe.ca/api/type/eto.forms.grid/cellediting.md): Occurs before a cell is being edited to allow canceling based on application logic
- [CellFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/cellformatting.md): Occurs when each cell is being formatted for font and color
- [ColumnHeaderClick](https://eto.picoe.ca/api/type/eto.forms.grid/columnheaderclick.md): Occurs when the column header has been clicked by the user
- [ColumnOrderChanged](https://eto.picoe.ca/api/type/eto.forms.grid/columnorderchanged.md): Event to handle when a column has been reordered by the user.
- [ColumnWidthChanged](https://eto.picoe.ca/api/type/eto.forms.grid/columnwidthchanged.md): Event to handle when a column width has been changed.
- [RowFormatting](https://eto.picoe.ca/api/type/eto.forms.grid/rowformatting.md): Occurs when each cell is being formatted for font and color
- [SelectedItemsChanged](https://eto.picoe.ca/api/type/eto.forms.grid/selecteditemschanged.md): Occurs when the [Grid.SelectedItems](https://eto.picoe.ca/api/type/eto.forms.grid/selecteditems.md) is changed.
- [SelectedRowsChanged](https://eto.picoe.ca/api/type/eto.forms.grid/selectedrowschanged.md): Occurs when the [Grid.SelectedRows](https://eto.picoe.ca/api/type/eto.forms.grid/selectedrows.md) is changed.
- [SelectionChanged](https://eto.picoe.ca/api/type/eto.forms.grid/selectionchanged.md): Occurs when the user has changed the selection in the grid

## Inherited Members

- From [Control](https://eto.picoe.ca/api/type/eto.forms.control.md): [AllowDrop](https://eto.picoe.ca/api/type/eto.forms.control/allowdrop.md), [BackgroundColor](https://eto.picoe.ca/api/type/eto.forms.control/backgroundcolor.md), [Bounds](https://eto.picoe.ca/api/type/eto.forms.control/bounds.md), [ContextMenu](https://eto.picoe.ca/api/type/eto.forms.control/contextmenu.md), [Cursor](https://eto.picoe.ca/api/type/eto.forms.control/cursor.md), [Enabled](https://eto.picoe.ca/api/type/eto.forms.control/enabled.md), [Gestures](https://eto.picoe.ca/api/type/eto.forms.control/gestures.md), [Handler](https://eto.picoe.ca/api/type/eto.forms.control/handler.md), [HasFocus](https://eto.picoe.ca/api/type/eto.forms.control/hasfocus.md), [Height](https://eto.picoe.ca/api/type/eto.forms.control/height.md), [IsAttached](https://eto.picoe.ca/api/type/eto.forms.control/isattached.md), [IsMouseCaptured](https://eto.picoe.ca/api/type/eto.forms.control/ismousecaptured.md), [IsSuspended](https://eto.picoe.ca/api/type/eto.forms.control/issuspended.md), [IsVisualControl](https://eto.picoe.ca/api/type/eto.forms.control/isvisualcontrol.md), [Loaded](https://eto.picoe.ca/api/type/eto.forms.control/loaded.md), [Location](https://eto.picoe.ca/api/type/eto.forms.control/location.md), [LogicalParent](https://eto.picoe.ca/api/type/eto.forms.control/logicalparent.md), [Parent](https://eto.picoe.ca/api/type/eto.forms.control/parent.md), [ParentWindow](https://eto.picoe.ca/api/type/eto.forms.control/parentwindow.md), [Size](https://eto.picoe.ca/api/type/eto.forms.control/size.md), [SupportedPlatformCommands](https://eto.picoe.ca/api/type/eto.forms.control/supportedplatformcommands.md), [TabIndex](https://eto.picoe.ca/api/type/eto.forms.control/tabindex.md), [TabStop](https://eto.picoe.ca/api/type/eto.forms.control/tabstop.md), [Tag](https://eto.picoe.ca/api/type/eto.forms.control/tag.md), [ToolTip](https://eto.picoe.ca/api/type/eto.forms.control/tooltip.md), [Visible](https://eto.picoe.ca/api/type/eto.forms.control/visible.md), [VisualControls](https://eto.picoe.ca/api/type/eto.forms.control/visualcontrols.md), [VisualParent](https://eto.picoe.ca/api/type/eto.forms.control/visualparent.md), [Width](https://eto.picoe.ca/api/type/eto.forms.control/width.md), [DragDrop](https://eto.picoe.ca/api/type/eto.forms.control/dragdrop.md), [DragEnd](https://eto.picoe.ca/api/type/eto.forms.control/dragend.md), [DragEnter](https://eto.picoe.ca/api/type/eto.forms.control/dragenter.md), [DragLeave](https://eto.picoe.ca/api/type/eto.forms.control/dragleave.md), [DragOver](https://eto.picoe.ca/api/type/eto.forms.control/dragover.md), [EnabledChanged](https://eto.picoe.ca/api/type/eto.forms.control/enabledchanged.md), [GotFocus](https://eto.picoe.ca/api/type/eto.forms.control/gotfocus.md), [KeyDown](https://eto.picoe.ca/api/type/eto.forms.control/keydown.md), [KeyUp](https://eto.picoe.ca/api/type/eto.forms.control/keyup.md), [Load](https://eto.picoe.ca/api/type/eto.forms.control/load.md), [LoadComplete](https://eto.picoe.ca/api/type/eto.forms.control/loadcomplete.md), [LostFocus](https://eto.picoe.ca/api/type/eto.forms.control/lostfocus.md), [MouseDoubleClick](https://eto.picoe.ca/api/type/eto.forms.control/mousedoubleclick.md), [MouseDown](https://eto.picoe.ca/api/type/eto.forms.control/mousedown.md), [MouseEnter](https://eto.picoe.ca/api/type/eto.forms.control/mouseenter.md), [MouseLeave](https://eto.picoe.ca/api/type/eto.forms.control/mouseleave.md), [MouseMove](https://eto.picoe.ca/api/type/eto.forms.control/mousemove.md), [MouseUp](https://eto.picoe.ca/api/type/eto.forms.control/mouseup.md), [MouseWheel](https://eto.picoe.ca/api/type/eto.forms.control/mousewheel.md), [PreLoad](https://eto.picoe.ca/api/type/eto.forms.control/preload.md), [Shown](https://eto.picoe.ca/api/type/eto.forms.control/shown.md), [SizeChanged](https://eto.picoe.ca/api/type/eto.forms.control/sizechanged.md), [TextInput](https://eto.picoe.ca/api/type/eto.forms.control/textinput.md), [ThemeChanged](https://eto.picoe.ca/api/type/eto.forms.control/themechanged.md), [UnLoad](https://eto.picoe.ca/api/type/eto.forms.control/unload.md), [ApplyStyles](https://eto.picoe.ca/api/type/eto.forms.control/applystyles.md), [AttachNative](https://eto.picoe.ca/api/type/eto.forms.control/attachnative.md), [CaptureMouse](https://eto.picoe.ca/api/type/eto.forms.control/capturemouse.md), [Detach](https://eto.picoe.ca/api/type/eto.forms.control/detach.md), [DetachNative](https://eto.picoe.ca/api/type/eto.forms.control/detachnative.md), [Dispose](https://eto.picoe.ca/api/type/eto.forms.control/dispose.md), [DoDragDrop](https://eto.picoe.ca/api/type/eto.forms.control/dodragdrop.md), [FindParent](https://eto.picoe.ca/api/type/eto.forms.control/findparent.md), [Focus](https://eto.picoe.ca/api/type/eto.forms.control/focus.md), [GetPreferredSize](https://eto.picoe.ca/api/type/eto.forms.control/getpreferredsize.md), [Invalidate](https://eto.picoe.ca/api/type/eto.forms.control/invalidate.md), [MapPlatformCommand](https://eto.picoe.ca/api/type/eto.forms.control/mapplatformcommand.md), [OnApplyCascadingStyles](https://eto.picoe.ca/api/type/eto.forms.control/onapplycascadingstyles.md), [OnDragDrop](https://eto.picoe.ca/api/type/eto.forms.control/ondragdrop.md), [OnDragEnd](https://eto.picoe.ca/api/type/eto.forms.control/ondragend.md), [OnDragEnter](https://eto.picoe.ca/api/type/eto.forms.control/ondragenter.md), [OnDragLeave](https://eto.picoe.ca/api/type/eto.forms.control/ondragleave.md), [OnDragOver](https://eto.picoe.ca/api/type/eto.forms.control/ondragover.md), [OnEnabledChanged](https://eto.picoe.ca/api/type/eto.forms.control/onenabledchanged.md), [OnGotFocus](https://eto.picoe.ca/api/type/eto.forms.control/ongotfocus.md), [OnKeyDown](https://eto.picoe.ca/api/type/eto.forms.control/onkeydown.md), [OnKeyUp](https://eto.picoe.ca/api/type/eto.forms.control/onkeyup.md), [OnLoad](https://eto.picoe.ca/api/type/eto.forms.control/onload.md), [OnLoadComplete](https://eto.picoe.ca/api/type/eto.forms.control/onloadcomplete.md), [OnLostFocus](https://eto.picoe.ca/api/type/eto.forms.control/onlostfocus.md), [OnMouseDoubleClick](https://eto.picoe.ca/api/type/eto.forms.control/onmousedoubleclick.md), [OnMouseDown](https://eto.picoe.ca/api/type/eto.forms.control/onmousedown.md), [OnMouseEnter](https://eto.picoe.ca/api/type/eto.forms.control/onmouseenter.md), [OnMouseLeave](https://eto.picoe.ca/api/type/eto.forms.control/onmouseleave.md), [OnMouseMove](https://eto.picoe.ca/api/type/eto.forms.control/onmousemove.md), [OnMouseUp](https://eto.picoe.ca/api/type/eto.forms.control/onmouseup.md), [OnMouseWheel](https://eto.picoe.ca/api/type/eto.forms.control/onmousewheel.md), [OnPreLoad](https://eto.picoe.ca/api/type/eto.forms.control/onpreload.md), [OnShown](https://eto.picoe.ca/api/type/eto.forms.control/onshown.md), [OnSizeChanged](https://eto.picoe.ca/api/type/eto.forms.control/onsizechanged.md), [OnStyleChanged](https://eto.picoe.ca/api/type/eto.forms.control/onstylechanged.md), [OnTextInput](https://eto.picoe.ca/api/type/eto.forms.control/ontextinput.md), [OnThemeChanged](https://eto.picoe.ca/api/type/eto.forms.control/onthemechanged.md), [OnUnLoad](https://eto.picoe.ca/api/type/eto.forms.control/onunload.md), [PointFromScreen](https://eto.picoe.ca/api/type/eto.forms.control/pointfromscreen.md), [PointToScreen](https://eto.picoe.ca/api/type/eto.forms.control/pointtoscreen.md), [Print](https://eto.picoe.ca/api/type/eto.forms.control/print.md), [RectangleFromScreen](https://eto.picoe.ca/api/type/eto.forms.control/rectanglefromscreen.md), [RectangleToScreen](https://eto.picoe.ca/api/type/eto.forms.control/rectangletoscreen.md), [ReleaseMouseCapture](https://eto.picoe.ca/api/type/eto.forms.control/releasemousecapture.md), [ResumeLayout](https://eto.picoe.ca/api/type/eto.forms.control/resumelayout.md), [SuspendLayout](https://eto.picoe.ca/api/type/eto.forms.control/suspendlayout.md), [TriggerStyleChanged](https://eto.picoe.ca/api/type/eto.forms.control/triggerstylechanged.md), [UpdateLayout](https://eto.picoe.ca/api/type/eto.forms.control/updatelayout.md)
- From [BindableWidget](https://eto.picoe.ca/api/type/eto.forms.bindablewidget.md): [Bindings](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/bindings.md), [DataContext](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/datacontext.md), [IsDataContextChanging](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/isdatacontextchanging.md), [Parents](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/parents.md), [DataContextChanged](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/datacontextchanged.md), [OnDataContextChanged](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/ondatacontextchanged.md), [Unbind](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/unbind.md), [UpdateBindings](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/updatebindings.md)
- From [Widget](https://eto.picoe.ca/api/type/eto.widget.md): [ControlObject](https://eto.picoe.ca/api/type/eto.widget/controlobject.md), [ID](https://eto.picoe.ca/api/type/eto.widget/id.md), [IsDisposed](https://eto.picoe.ca/api/type/eto.widget/isdisposed.md), [NativeHandle](https://eto.picoe.ca/api/type/eto.widget/nativehandle.md), [Platform](https://eto.picoe.ca/api/type/eto.widget/platform.md), [Properties](https://eto.picoe.ca/api/type/eto.widget/properties.md), [Style](https://eto.picoe.ca/api/type/eto.widget/style.md), [StyleChanged](https://eto.picoe.ca/api/type/eto.widget/stylechanged.md), [Dispose](https://eto.picoe.ca/api/type/eto.widget/dispose.md), [Initialize](https://eto.picoe.ca/api/type/eto.widget/initialize.md), [ToString](https://eto.picoe.ca/api/type/eto.widget/tostring.md)
