# UserInterfaceGrid class

Namespace: [Rhino.UI](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.ui.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public class UserInterfaceGrid : UserInterfaceControl
```

Arranges child controls in a grid of rows and columns. The common case is a two or three column grid where the first column holds labels describing values and the remaining columns hold the controls that edit those values, which produces something that looks like the Rhino object properties pages. Children fill the grid in row major order: a new row starts every ColumnCount children, so a two column grid built by adding label, control, label, control, ... reads the way it looks. Settings can be made before or after the grid is added to a document. The ones made beforehand are held here and applied when the native grid is created.

## Constructors

- [UserInterfaceGrid](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/ctor.md): (2 overloads)

## Properties

- [BackgroundClaimsMouse](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/backgroundclaimsmouse.md): Whether a click where the grid has no child control belongs to the grid or to whatever is behind it. The default is false, so clicks on the padding, on the gaps between cells and on empty cells go through to the viewport, which is what a heads up display over a model wants.
- [BackgroundOpacity](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/backgroundopacity.md): How opaque the background is, from 0 (not drawn at all) to 1 (solid, the default). Leave BackgroundColor as Color.Empty and the grid uses the theme's panel color at this opacity, which gives a see through panel over the model that still follows the theme. A BackgroundColor that was set is drawn at this opacity on top of its own alpha. The border is not affected.
- [BorderColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/bordercolor.md)
- [BorderThickness](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/borderthickness.md)
- [ChildCount](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/childcount.md): Number of cells that have been filled, including the empty ones added with AddEmptyCell. This is not the same as ColumnCount * RowCount.
- [ColumnCount](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/columncount.md): Number of columns in the grid. The default is 1. Changing the column count reflows the children that have already been added.
- [ColumnSpacing](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/columnspacing.md): Space between columns in logical pixels. The default is 6.
- [CornerRadius](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/cornerradius.md)
- [RowCount](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/rowcount.md): Number of rows the current children occupy, computed from the child count, the column count and any column spans.
- [RowHeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/rowheight.md): Height of every row in logical pixels. The default is 0, which means each row is as tall as the tallest control in it.
- [RowSeparatorColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/rowseparatorcolor.md)
- [RowSeparators](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/rowseparators.md): Draw a horizontal line between every pair of rows. Off by default.
- [RowSpacing](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/rowspacing.md): Space between rows in logical pixels. The default is 2.

## Methods

- [AddChild](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/addchild.md): Append a control to the next cell.
- [AddEmptyCell](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/addemptycell.md): Append a cell with nothing in it. Use this to leave a hole in a row.
- [AddHeading](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/addheading.md): Append a label that spans every column, for a section heading.
- [AddLabel](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/addlabel.md): Append a label to the next cell, which is what most first column cells are. The label is returned so that its text alignment, color or height can be adjusted.
- [Cell](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/cell.md): Control in a cell by row and column, or null when that cell is empty. The grid has to have been added to a document for this to find anything, since it is the native grid that knows which cell a child ended up in.
- [Child](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/child.md): Control in a cell, or null for an empty cell or an out of range index.
- [EnableRowSeparatorBelowRow](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/enablerowseparatorbelowrow.md): Draw a horizontal line under one row, for a heading row that wants a rule under it when a line between every row would be too much. RowSeparators draws them all whatever this is set to.
- [GetChildColumnSpan](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/getchildcolumnspan.md)
- [GetColumnSizing](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/getcolumnsizing.md)
- [GetColumnWidth](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/getcolumnwidth.md): Width of a column in logical pixels as of the most recent layout. This is 0 until the grid has been drawn once.
- [GetComputedRowHeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/getcomputedrowheight.md): Height of a row in logical pixels as of the most recent layout. This is 0 until the grid has been drawn once.
- [InsertChild](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/insertchild.md): Insert a control at a cell index, shifting the controls after it along.
- [RemoveAllChildren](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/removeallchildren.md): Empty the grid.
- [RemoveChild](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/removechild.md): Take a control out of the grid. Returns the control that was in the cell, or null for an empty cell or an out of range index.
- [SetChildColumnSpan](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setchildcolumnspan.md): Number of columns a cell occupies. The default is 1. Use this for a section heading or a control that runs the full width of the grid. A span is clamped to the number of columns left in the row.
- [SetColumnAutoWidth](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setcolumnautowidth.md): Make a column as wide as the widest control in it. Controls report their width from their computed size, so a label column sized this way is exactly as wide as its longest description.
- [SetColumnContentAlignment](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setcolumncontentalignment.md): How the controls in a column sit in their cells. The default is Stretch / Center, which makes a control fill the column width and center itself in the row. Any horizontal setting other than Stretch gives the control the width it reports from its computed size.
- [SetColumnFixedWidth](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setcolumnfixedwidth.md): Give a column a width in logical pixels that is never resized.
- [SetColumnFlexibleWidth](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setcolumnflexiblewidth.md): Have a column share the width the fixed and auto columns do not use. With one flexible column that column gets all of the remaining width; with more than one the remainder is divided in proportion to the weights.
- [SetColumnMinimumWidth](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setcolumnminimumwidth.md): Width a column never goes below, in logical pixels. The default is 0.
- [SetPadding](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacegrid/setpadding.md): (2 overloads)

## Inherited Members

- From [UserInterfaceControl](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol.md): [BackgroundColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/backgroundcolor.md), [HorizontalAlignment](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/horizontalalignment.md), [Location](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/location.md), [Size](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/size.md), [Text](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/text.md), [TextColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/textcolor.md), [TextHeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/textheight.md), [TextHorizontalAlignment](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/texthorizontalalignment.md), [TextVerticalAlignment](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/textverticalalignment.md), [TrackingPoint](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/trackingpoint.md), [VerticalAlignment](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/verticalalignment.md), [ComputedRectangle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/computedrectangle.md), [SetSvg](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfacecontrol/setsvg.md)
- From [UserInterfaceObjectBase](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase.md): [BoundToActiveView](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/boundtoactiveview.md), [HasKeyboardFocus](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/haskeyboardfocus.md), [Tooltip](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/tooltip.md), [Visible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/visible.md), [IsMouseOver](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/ismouseover.md), [IsRegistered](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/isregistered.md), [OnDraw](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/ondraw.md), [OnMouseClick](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmouseclick.md), [OnMouseDoubleClick](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmousedoubleclick.md), [OnMouseDown](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmousedown.md), [OnMouseEnter](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmouseenter.md), [OnMouseLeave](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmouseleave.md), [OnMouseMove](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmousemove.md), [OnMouseUp](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onmouseup.md), [OnRunCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/onruncommand.md), [RegisterForAllDocuments](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/registerforalldocuments.md), [RunCommand](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/runcommand.md), [Unregister](https://developer.rhino3d.com/api/rhinocommon/type/rhino.ui.userinterfaceobjectbase/unregister.md)
