DataGrid REALbasic Plugin

DataGrid Control

DataGrid control to display styled spread sheet data.

The DataGrid is similar to the Einhugur StyleGrid control except that DataGrid has no methods to insert, update or delete rows, the way it works is that the programmer sets the number of rows, and then the DataGrid will request data for the rows on the fly once it needs to draw the row or access it in any other way.

Note:
Always set the Rows property to 0 before you apply a new query to reset the info on which rows have been loaded and which have not. (Or use the ReQuery method)

RectControl
   DataGrid

control DataGrid

Properties

AreaSelectionTo enable or disable area selection.
CancelEventActionTo cancel a internal handling of a event then set the CancelEventAction property to true from within a event.
CellEvenColorTo set or get the back color of even numbered cells use the CellEvenColor property.
CellOddColorTo set or get the back color of odd numbered cells use the CellOddColor property.
ColsTo set or get the column count.
CornerBtnEnabledTo determine if the cornerbutton should be enabled or not.
DefaultColumnWidthTo set or get the default column width of the DataGrid.
DefaultRowHeightTo set or get the default row height.
EvenBackColorSets or gets the color for even numbered out of bounds cells.
FreezeColsSets the number of columns to freeze to the left.
GetFocusOnClickSet this property to true if the control should get focus when its clicked.
GridLineColorTo set or get the grid line color.
HasBackColorThis property is used to determine if the DataGrid should use other than its default BackColor.
HasCellGridLineColorThis property is used to determine if the DataGrid should use other than its default CellGridLineColor.
HasHeaderIf the control should have a header then set this property to true.
HasHeaderBackColorThis property is used to determine if the DataGrid should use other than its default HeaderBackColor.
HasInactiveSelectionColorThis property is used to determine if the DataGrid should use other than its default InactiveSelectionColor.
HasOutOfBoundsGridLineColorThis property is used to determine if the DataGrid should use other than its default CellOutOfBoundsGridLineColor.
HasSelectedTextColorIf this property is set to true then the color defined in the SelectedTextColor property is used for text in selected cells, and by doing that overriding the Text color that is defined in the style for the selected cells.
HasSelectionColorThis property is used to determine if the DataGrid should use other than its default SelectionColor.
HorizontalGridTo determine if the horizontal grid lines should be visible or not.
HorizontalScrollbarTo determine if an horizontal scrollbar should be visible or not.
HotTrackLets rows be hot tracked when mouse hovers over them on Windows systems.
HScrollValueTo set or get the horizontal scrollbar value.
InactiveSelectionColorTo set or get the selection color when the grid is deactivated.
LiveScrollTo enable LiveScroll then check this property in the property browser.
LockDrawingTo set or get LockDrawing value.
OddBackColorSets or gets the color for odd numbered out of bounds cells.
OutOfBoundsGridLineColorTo set or get the grid line color for out of bounds non existing cells.
PopupMenuCellFullSensitivity
RenderSortOrderThis property is used to determine if the sort order icon should be rendered in the corner button.
RowsTo set or get the row count.
SelectEntireRowTo set the selection mode to Row or to Single cell.
SelectedTextColorSets the color that is used for text in selected cells, and by doing that overriding the Text color that is defined in the style for the selected cells.
SelectionColorTo set or get the selection color.
ShadeSelectionLets selected row be shaded with platform gradients using Quartz shading on MacOS X Cocoa, GDI plus on Windows and Cairo on Linux systems.
ShowResizeGlyphTo determine if a space should be available for the Grow button or not.
SortedBackwardsFlagUse this property to set or get the the sort order direction that is drawn. If set to true then the sort indicator is drawn to represent a backward sort.
SortIndicatorColumnThis property is used to set or get the number of the column which should display a sort indicator.
StartupCocoaFont
StartupLinuxFontUse this property to set the initial font name on Linux Target platforms for the default Style.
StartupLinuxFontSizeUse this property to set the initial font size on Linux Target platforms for the default Style.
StartupMacFontUse this property to set the initial font name on MacOS Target platforms for the default Style.
StartupMacFontSizeUse this property to set the initial font size on MacOS Target platforms for the default Style.
StartupWin32FontUse this property to set the initial font name on Win32 Target platforms for the default Style.
StartupWin32FontSizeUse this property to set the initial font size on Win32 Target platforms for the default Style.
UseFocusRingThis property is used to determine if the DataGrid should show a focus ring or not.
VerticalGridThis property is used to determine if the vertical grid should be visible or not.
VerticalScrollbarTo determine if an vertical scrollbar should be visible or not.
VScrollValueTo set or get the vertical scrollbar value.

Methods

CellThis property is used to access the data of a cell.
CellBoundsReturns the bounds of a specified cell.
CellFromPointFinds a cell from a point inside the DataGrid control. This variation of the CellFromPoint also gives information if the given point could trigger a cell action.
CellFromPointFinds a cell from a point inside the DataGrid control.
CellTextTo get the text of a cell.
ColumnTo get a specific column from the grid use the Column function.
DrawCellThis method is used to redraw one cell only.
EditCellTo manually put a cell in edit mode.
GetDefaultCellThis property is used to access the data from the StyleGrid Default Cell object.
GetDefaultStyleThis function is used to access the default style object that all cells that have no style assigned to them use.
GetHeaderDefaultStyleThis function is used to access the default style object that all headers that have no style assigned to them use.
GetMeasureRetrieves a measurement from a given measurement constant from the DataGrid.
GetStaticRowsThis function is used to get the index number of all rows that are static.
InsertColTo insert a column.
InvalidateRowForces a row out of the dynamic cache and by doing that then the Grid will call call the RequestRowData event next time that the Grid will draw that row.
MakeRowDynamicThis function is used to change a static row back to a dynamic row.
MakeRowStaticThis function is used to change a dynamic row static. That is making a row which is not stored in memory except when visible on the screen to be stored always in memory.
MoveSelectionDownThis method is used to move the selection cursor down.
MoveSelectionLeftThis method is used to move the selection cursor to left.
MoveSelectionRightThis method is used to move the selection cursor to left.
MoveSelectionUpThis method is used to move the selection cursor up.
RemoveColTo remove a column from the DataGrid.
ReQueryThis method is used do a ReQuery on the DataGrid. This method does the same as setting the Rows property to a new value, except this method gives control over if static rows should be preserved or not.
RowThis property is used to access the data of a row.
RowIsStaticThis function returns true if the given row is static. (A row preserved in memory when its scrolled out of the screen)
RowsOnScreenThis function returns the count of rows that are fully visible vertically on the screen.
SelectionReturns a instance of the DataGridSelection class which represents the state of the selection in the Grid control.

Events

AfterMouseDownThis event if fired after a MouseDown event. When this event is fired then all internal MouseDown handling has been completed.
CellActionThis event is fired when a action is performed on a special cell.
CellDblClickThe user has double-clicked on a cell.
ColumnHeaderClickThe user has pressed the mouse button in a column header.
ControlCreatedThis event is fired when the control has been safely created.
ControlResizedThis event is fired when the control is getting Resized.
CornerBtnClickThe user has clicked the Corner button, usually to define the sort order.
EnableMenuItemsFires when user has clicked in the menu bar or pressed a keyboard shortcut assigned to one of the menu items.
GotFocusThis event is generated when the grid gets the keyboard focus.
KeyDownThis event is fired when a keyboard key is hit when the Grid has the focus.
LostFocusThis event is generated when the grid looses keyboard focus.
MouseDownThe mouse button was pressed inside the StyleGrid at the location passed into x, y.
MouseDragThe MouseDrag event is fired when a mouse drag event is generated within the control.
MouseExitThis event is fired when the mouse leaves the control.
MouseMoveThis event is fired when the mouse is hovering over the control.
MouseUpThe mouse button was released inside the StyleGrid at the location passed into x, y.
MouseWheelThe mouse wheel has been moved.
OnEditCellThis event is fired when a cell is supposed to go in edit mode.
OnHScollThis event is fired when the value of the Horizontal scrollbar changes.
OnVScollThis event is fired when the value of the Vertical scrollbar changes.
RenderCornerBtnThis event is posted to give applications chance to custom render the content of the CornerButton.
RequestRowDataThis event is fired when the DataGrid wants data for a row.
SelectionChangedThe selection changed. This can be triggered by clicking a cell, removing rows and in many other ways.

Supported Platforms:

  • PPC - MacOS 9
  • Carbon - MacOS 9 and MacOS X (PEF)
  • MacOS X PPC - (Mach-O)
  • MacOS X Universal Binary (Mach-O)
  • Win32 - Windows
  • Linux x86