Skip to main content

DataGrid Class

Package: GHIElectronics.Endpoint.UI
Namespace: GHIElectronics.Endpoint.UI

Simple grid of text cells (standard WPF widget name; TinyCLR-shape API). Call DataGrid.SetSize to allocate rows and columns, then DataGrid.SetCell to fill each cell.

class DataGrid(Widget): ...

Constructors​

DataGrid(Widget parent)​

def __init__(self, parent: Widget):

Create a data grid inside parent.

ParameterTypeDescription
parentWidgetContaining widget.

Methods​

SetCell(int row, int column, string text)​

def SetCell(self, row: int, column: int, text: str) -> None:

Set the text in a single cell.

ParameterTypeDescription
rowint0-based row index.
columnint0-based column index.
textstringCell contents; null is treated as empty.

SetColumnWidth(int column, int px)​

def SetColumnWidth(self, column: int, px: int) -> None:

Set a single column's width in pixels.

ParameterTypeDescription
columnint0-based column index.
pxintWidth in pixels.

SetSize(int columns, int rows)​

def SetSize(self, columns: int, rows: int) -> None:

Allocate the grid dimensions. Must be called before DataGrid.SetCell.

ParameterTypeDescription
columnsintNumber of columns.
rowsintNumber of rows.