Class GroupGridEngine
Represents the non-visual state, data adapter, columns, and row projection of a group grid.
public class GroupGridEngine
- Inheritance
-
GroupGridEngine
- Inherited Members
- Extension Methods
Constructors
GroupGridEngine()
Initializes a new instance of the GroupGridEngine class.
public GroupGridEngine()
Properties
BodyHeight
Gets the rendered body height used for hit testing.
public double BodyHeight { get; }
Property Value
Columns
Gets the grid columns.
public ObservableCollection<GroupGridColumn> Columns { get; }
Property Value
CurrentCell
Gets the current cell.
public GroupGridCell CurrentCell { get; }
Property Value
CurrentColumn
Gets the current column, or null when there is no current cell.
public GroupGridColumn CurrentColumn { get; }
Property Value
CurrentRowIndex
Gets the current row index, or -1 when there is no current cell.
public int CurrentRowIndex { get; }
Property Value
DataAdapter
Gets or sets the data adapter.
public IGroupGridDataAdapter DataAdapter { get; set; }
Property Value
EditingCell
Gets the editing cell.
public GroupGridCell EditingCell { get; }
Property Value
FilterCount
Gets the number of active column filters.
public int FilterCount { get; }
Property Value
GroupColumnCount
Gets the number of grouped columns.
public int GroupColumnCount { get; }
Property Value
GroupColumns
Gets the grouped columns in grouping order.
public IReadOnlyList<GroupGridColumn> GroupColumns { get; }
Property Value
HasCurrentCell
Gets a value indicating whether the grid has a current cell.
public bool HasCurrentCell { get; }
Property Value
HasFilters
Gets a value indicating whether any column filter is active.
public bool HasFilters { get; }
Property Value
HasSelectedCell
Gets a value indicating whether the grid has a selected cell.
public bool HasSelectedCell { get; }
Property Value
IsEditing
Gets a value indicating whether the grid is editing a cell.
public bool IsEditing { get; }
Property Value
IsReadOnly
Gets or sets a value indicating whether editing is disabled for the whole grid.
public bool IsReadOnly { get; set; }
Property Value
LayoutMetrics
Gets the layout metrics used by non-visual hit testing.
public GroupGridLayoutMetrics LayoutMetrics { get; }
Property Value
RowCount
Gets the number of adapter rows.
public int RowCount { get; }
Property Value
SelectedCell
Gets the selected cell.
public GroupGridCell SelectedCell { get; }
Property Value
SelectedColumn
Gets the selected column, or null when there is no selected cell.
public GroupGridColumn SelectedColumn { get; }
Property Value
SelectedRowIndex
Gets the selected row index, or -1 when there is no selected cell.
public int SelectedRowIndex { get; }
Property Value
SortColumn
Gets the sorted column, or null when sorting is not active.
public GroupGridColumn SortColumn { get; }
Property Value
SortDirection
Gets the active sort direction.
public GroupGridSortDirection SortDirection { get; }
Property Value
Viewport
Gets the viewport window into the logical visible-node list.
public GroupGridViewport Viewport { get; }
Property Value
VisibleNodeCount
Gets the number of visible projected nodes.
public int VisibleNodeCount { get; }
Property Value
Methods
BeginEdit()
Begins editing the current cell.
public bool BeginEdit()
Returns
- bool
True if editing started; otherwise, false.
BeginEdit(GroupGridCell)
Begins editing a cell.
public bool BeginEdit(GroupGridCell Cell)
Parameters
CellGroupGridCellThe cell to edit.
Returns
- bool
True if editing started; otherwise, false.
BeginEdit(int, GroupGridColumn)
Begins editing a cell by row index and column.
public bool BeginEdit(int RowIndex, GroupGridColumn Column)
Parameters
RowIndexintThe adapter row index.
ColumnGroupGridColumnThe grid column.
Returns
- bool
True if editing started; otherwise, false.
CanDeleteCurrentRow()
Returns true when the current row can be deleted.
public bool CanDeleteCurrentRow()
Returns
- bool
True when the current row can be deleted; otherwise, false.
CanInsertRow()
Returns true when a new row can be inserted after the current row.
public bool CanInsertRow()
Returns
- bool
True when a row can be inserted; otherwise, false.
CanSetValue(int, GroupGridColumn)
Returns true when a value can be set at a specified adapter row index and column.
public bool CanSetValue(int RowIndex, GroupGridColumn Column)
Parameters
RowIndexintThe adapter row index.
ColumnGroupGridColumnThe grid column.
Returns
- bool
True when the cell value can be set; otherwise, false.
CancelEdit()
Cancels the current edit.
public bool CancelEdit()
Returns
- bool
True if an edit was canceled; otherwise, false.
ClearColumnFilter(GroupGridColumn)
Clears the text filter for a column.
public bool ClearColumnFilter(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- bool
True if the filter changed; otherwise, false.
ClearCurrentCell()
Clears the current cell.
public void ClearCurrentCell()
ClearFilters()
Clears all column filters.
public bool ClearFilters()
Returns
- bool
True if any filter was cleared; otherwise, false.
ClearSelection()
Clears the selected cell.
public void ClearSelection()
ClearSort()
Clears the active column sorting.
public bool ClearSort()
Returns
- bool
True if sorting changed; otherwise, false.
CommitEdit(object)
Commits the edited value.
public bool CommitEdit(object Value)
Parameters
ValueobjectThe editor value.
Returns
- bool
True if the edit was committed; otherwise, false.
DeleteCurrentRow()
Deletes the current row.
public bool DeleteCurrentRow()
Returns
- bool
True if a row was deleted; otherwise, false.
GetColumnFilter(GroupGridColumn)
Returns the text filter applied to a column.
public string GetColumnFilter(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- string
The filter text, or an empty string when no filter is applied.
GetDisplayText(int, GroupGridColumn)
Returns the display text for a visible body row and value column.
public string GetDisplayText(int VisibleNodeIndex, GroupGridColumn Column)
Parameters
VisibleNodeIndexintThe visible-node index.
ColumnGroupGridColumnThe grid column.
Returns
- string
The display text.
GetGroupHeaderText(int)
Returns the display text for a group header row.
public string GetGroupHeaderText(int VisibleNodeIndex)
Parameters
VisibleNodeIndexintThe visible-node index.
Returns
- string
The group header display text.
GetGroupSummary(int, GroupGridColumn)
Returns a group summary value by visible-node index and column.
public GroupGridSummaryValue GetGroupSummary(int VisibleNodeIndex, GroupGridColumn Column)
Parameters
VisibleNodeIndexintThe visible-node index.
ColumnGroupGridColumnThe grid column.
Returns
- GroupGridSummaryValue
The summary value.
GetTotalSummary(GroupGridColumn)
Returns a total summary value by column.
public GroupGridSummaryValue GetTotalSummary(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- GroupGridSummaryValue
The summary value.
GetTotalSummaryText(GroupGridColumn)
Returns the display text for a footer summary cell.
public string GetTotalSummaryText(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- string
The footer summary display text.
GetValue(int, GroupGridColumn)
Returns the cell value at a specified adapter row index and column.
public object GetValue(int RowIndex, GroupGridColumn Column)
Parameters
RowIndexintThe adapter row index.
ColumnGroupGridColumnThe grid column.
Returns
- object
The cell value.
GetVisibleColumns()
Returns the visible columns in display order.
public IReadOnlyList<GroupGridColumn> GetVisibleColumns()
Returns
- IReadOnlyList<GroupGridColumn>
The visible columns.
GetVisibleRow(int)
Returns the source row at a visible node index.
public object GetVisibleRow(int VisibleNodeIndex)
Parameters
VisibleNodeIndexintThe visible node index.
Returns
- object
The source row, or null when the visible node is not a data row.
GetVisibleRowInfo(int)
Returns information about a visible row.
public GroupGridRowInfo GetVisibleRowInfo(int VisibleNodeIndex)
Parameters
VisibleNodeIndexintThe visible-node index.
Returns
- GroupGridRowInfo
The visible row information.
GetVisibleValueColumns()
Returns the visible value columns in display order.
public IReadOnlyList<GroupGridColumn> GetVisibleValueColumns()
Returns
- IReadOnlyList<GroupGridColumn>
The visible value columns.
GroupColumn(GroupGridColumn, int)
Adds a column to the grouping list.
public bool GroupColumn(GroupGridColumn Column, int GroupIndex = -1)
Parameters
ColumnGroupGridColumnThe grid column.
GroupIndexintThe group index, or -1 to append.
Returns
- bool
True if the column was grouped; otherwise, false.
HitTest(double, double)
Returns hit-test information for a point in local grid coordinates.
public GroupGridHitTestResult HitTest(double X, double Y)
Parameters
Returns
- GroupGridHitTestResult
The hit-test result.
IndexOfVisibleColumn(GroupGridColumn)
Returns the visible column index of a specified column.
public int IndexOfVisibleColumn(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- int
The visible column index, or -1 if not found.
IndexOfVisibleRow(int)
Returns the visible-node index of a specified adapter row index.
public int IndexOfVisibleRow(int RowIndex)
Parameters
RowIndexintThe adapter row index.
Returns
- int
The visible-node index, or -1 if not found.
InsertRow()
Inserts a new row after the current row.
public bool InsertRow()
Returns
- bool
True if a row was inserted; otherwise, false.
IsGroupedColumn(GroupGridColumn)
Returns true when a column is grouped.
public bool IsGroupedColumn(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- bool
True if the column is grouped; otherwise, false.
IsSelectedCell(GroupGridCell)
Returns true when a cell is selected.
public bool IsSelectedCell(GroupGridCell Cell)
Parameters
CellGroupGridCellThe cell to check.
Returns
- bool
True if the cell is selected; otherwise, false.
IsSelectedRow(int)
Returns true when an adapter row is selected.
public bool IsSelectedRow(int RowIndex)
Parameters
RowIndexintThe adapter row index.
Returns
- bool
True if the row is selected; otherwise, false.
MoveColumn(GroupGridColumn, int)
Moves a column to a new display index in the column collection.
public bool MoveColumn(GroupGridColumn Column, int ColumnIndex)
Parameters
ColumnGroupGridColumnThe grid column.
ColumnIndexintThe new column index.
Returns
- bool
True if the column moved; otherwise, false.
MoveCurrentCell(int, int)
Moves the current cell by visible row and column deltas.
public bool MoveCurrentCell(int RowDelta, int ColumnDelta)
Parameters
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentColumn(int)
Moves the current cell horizontally by a visible column delta.
public bool MoveCurrentColumn(int ColumnDelta)
Parameters
ColumnDeltaintThe visible column delta.
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentRow(int)
Moves the current cell vertically by a visible data-row delta.
public bool MoveCurrentRow(int RowDelta)
Parameters
RowDeltaintThe visible row delta.
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentToFirstColumn()
Moves the current cell to the first visible value column in the current row.
public bool MoveCurrentToFirstColumn()
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentToFirstRow()
Moves the current cell to the first visible data row.
public bool MoveCurrentToFirstRow()
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentToLastColumn()
Moves the current cell to the last visible value column in the current row.
public bool MoveCurrentToLastColumn()
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentToLastRow()
Moves the current cell to the last visible data row.
public bool MoveCurrentToLastRow()
Returns
- bool
True if the current cell moved; otherwise, false.
MoveCurrentToNextEditableCell(bool)
Moves the current cell to the next editable visible cell.
public bool MoveCurrentToNextEditableCell(bool Forward)
Parameters
ForwardboolTrue to move forward; false to move backward.
Returns
- bool
True if the current cell moved; otherwise, false.
MoveGroupedColumn(GroupGridColumn, int)
Moves a grouped column to a new group index.
public bool MoveGroupedColumn(GroupGridColumn Column, int GroupIndex)
Parameters
ColumnGroupGridColumnThe grouped column.
GroupIndexintThe new group index.
Returns
- bool
True if the column moved; otherwise, false.
RebuildProjection()
Rebuilds the root-node and visible-node projection from the current data adapter.
public void RebuildProjection()
RequestEdit()
Raises the edit requested event.
public void RequestEdit()
SelectCurrentCell()
Selects the current cell.
public bool SelectCurrentCell()
Returns
- bool
True if the selected cell changed; otherwise, false.
SetColumnFilter(GroupGridColumn, string)
Sets the contains-text filter for a column.
public bool SetColumnFilter(GroupGridColumn Column, string FilterText)
Parameters
ColumnGroupGridColumnThe grid column.
FilterTextstringThe filter text.
Returns
- bool
True if the filter changed; otherwise, false.
SetColumnVisible(GroupGridColumn, bool)
Shows or hides a column.
public bool SetColumnVisible(GroupGridColumn Column, bool IsVisible)
Parameters
ColumnGroupGridColumnThe grid column.
IsVisibleboolTrue to show the column; false to hide it.
Returns
- bool
True if the column visibility changed; otherwise, false.
SetCurrentCell(GroupGridCell)
Sets the current cell.
public bool SetCurrentCell(GroupGridCell Cell)
Parameters
CellGroupGridCellThe current cell.
Returns
- bool
True if the current cell changed; otherwise, false.
SetCurrentCell(int, GroupGridColumn)
Sets the current cell by row index and column.
public bool SetCurrentCell(int RowIndex, GroupGridColumn Column)
Parameters
RowIndexintThe adapter row index.
ColumnGroupGridColumnThe grid column.
Returns
- bool
True if the current cell changed; otherwise, false.
SetGroupExpanded(int, bool)
Sets the expanded state of a group node by visible-node index.
public bool SetGroupExpanded(int VisibleNodeIndex, bool IsExpanded)
Parameters
Returns
- bool
True if the group state changed; otherwise, false.
SetSelectedCell(GroupGridCell)
Sets the selected cell.
public bool SetSelectedCell(GroupGridCell Cell)
Parameters
CellGroupGridCellThe selected cell.
Returns
- bool
True if the selected cell changed; otherwise, false.
SetSelectedCell(int, GroupGridColumn)
Sets the selected cell by row index and column.
public bool SetSelectedCell(int RowIndex, GroupGridColumn Column)
Parameters
RowIndexintThe adapter row index.
ColumnGroupGridColumnThe grid column.
Returns
- bool
True if the selected cell changed; otherwise, false.
SetValue(int, GroupGridColumn, object)
Sets the cell value at a specified adapter row index and column.
public void SetValue(int RowIndex, GroupGridColumn Column, object Value)
Parameters
RowIndexintThe adapter row index.
ColumnGroupGridColumnThe grid column.
ValueobjectThe value to set.
SetViewport(GroupGridViewport)
Sets the viewport window into the logical visible-node list.
public bool SetViewport(GroupGridViewport Viewport)
Parameters
ViewportGroupGridViewportThe viewport.
Returns
- bool
True if the viewport changed; otherwise, false.
SetViewport(GroupGridViewport, double)
Sets the viewport window and the rendered body height.
public bool SetViewport(GroupGridViewport Viewport, double BodyHeight)
Parameters
ViewportGroupGridViewportThe viewport.
BodyHeightdoubleThe rendered body height.
Returns
- bool
True if the viewport or body height changed; otherwise, false.
ToggleGroupExpanded(int)
Toggles the expanded state of a group node by visible-node index.
public bool ToggleGroupExpanded(int VisibleNodeIndex)
Parameters
VisibleNodeIndexintThe visible-node index.
Returns
- bool
True if the group state changed; otherwise, false.
ToggleSort(GroupGridColumn)
Toggles sorting for a column using the None, Ascending, Descending cycle.
public bool ToggleSort(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe column to sort by.
Returns
- bool
True if sorting changed; otherwise, false.
UngroupColumn(GroupGridColumn)
Removes a column from the grouping list.
public bool UngroupColumn(GroupGridColumn Column)
Parameters
ColumnGroupGridColumnThe grid column.
Returns
- bool
True if the column was ungrouped; otherwise, false.
Events
BeginningEdit
Occurs before cell editing begins.
public event EventHandler<GroupGridCellEditEventArgs> BeginningEdit
Event Type
CellValidating
Occurs before an edited value is committed.
public event EventHandler<GroupGridCellEditEventArgs> CellValidating
Event Type
CellValueCommitted
Occurs after the value is written to the adapter.
public event EventHandler<GroupGridCellEditEventArgs> CellValueCommitted
Event Type
CellValueCommitting
Occurs after validation and before the value is written to the adapter.
public event EventHandler<GroupGridCellEditEventArgs> CellValueCommitting
Event Type
ColumnsChanged
Occurs when the columns collection changes.
public event EventHandler ColumnsChanged
Event Type
CurrentCellChanged
Occurs when the current cell changes.
public event EventHandler CurrentCellChanged
Event Type
CurrentRowChanged
Occurs when the current row changes.
public event EventHandler CurrentRowChanged
Event Type
DataAdapterChanged
Occurs when the data adapter changes.
public event EventHandler DataAdapterChanged
Event Type
DataChanged
Occurs when the adapter reports a data change.
public event EventHandler<GroupGridDataChangedEventArgs> DataChanged
Event Type
DeletingRow
Occurs before a row is deleted.
public event EventHandler<GroupGridRowOperationEventArgs> DeletingRow
Event Type
EditCanceled
Occurs when editing is canceled.
public event EventHandler<GroupGridCellEditEventArgs> EditCanceled
Event Type
EditRequested
Occurs when edit is requested by a toolbar command.
public event EventHandler EditRequested
Event Type
EditingCellChanged
Occurs when the editing cell changes.
public event EventHandler EditingCellChanged
Event Type
FiltersChanged
Occurs when column filters change.
public event EventHandler FiltersChanged
Event Type
GroupColumnsChanged
Occurs when the grouped columns list changes.
public event EventHandler GroupColumnsChanged
Event Type
InsertingRow
Occurs before a row is inserted.
public event EventHandler<GroupGridRowOperationEventArgs> InsertingRow
Event Type
RowDeleted
Occurs after a row is deleted.
public event EventHandler<GroupGridRowOperationEventArgs> RowDeleted
Event Type
RowInserted
Occurs after a row is inserted.
public event EventHandler<GroupGridRowOperationEventArgs> RowInserted
Event Type
SelectionChanged
Occurs when the selected cell changes.
public event EventHandler SelectionChanged
Event Type
SortingChanged
Occurs when column sorting changes.
public event EventHandler SortingChanged
Event Type
SummariesChanged
Occurs when summary values change.
public event EventHandler SummariesChanged
Event Type
ViewportChanged
Occurs when the viewport window into the logical visible-node list changes.
public event EventHandler ViewportChanged
Event Type
VisibleNodesChanged
Occurs when the logical flat list of visible nodes changes. This is the full row projection after grouping or expansion rules, not the viewport subset currently rendered on screen.
public event EventHandler VisibleNodesChanged