Skip to content

DataGridControl class

Displays data from a data source as rows and columns with support for sorting, grouping, filtering, and editing.

public class DataGridControl : DataControlBase, IDataControl

Public Members

name description
DataGridControl() Initializes a new instance of the DataGridControl class.
AllowBandResizing { get; set; } Gets or sets whether users can resize bands.
AllowBestFit { get; set; } Gets or sets whether users can apply best-fit column sizing.
AllowColumnFiltering { get; set; } Gets or sets whether users can filter data by column.
AllowColumnMoving { get; set; } Gets or sets whether users can reorder columns by dragging their headers.
AllowColumnResizing { get; set; } Gets or sets whether users can resize columns.
AllowDragDrop { get; set; } Gets or sets whether row drag-and-drop is enabled.
AllowDragDropSortedRows { get; set; } Gets or sets whether rows can be dragged when the data is sorted.
AllowEditingTotalSummaries { get; set; } Gets or sets whether users can edit total summaries.
AllowGrouping { get; set; } Gets or sets whether users can group data.
AllowHorizontalVirtualization { get; set; } Gets or sets whether off-screen columns are virtualized.
AllowResetColumnWidth { get; set; } Gets or sets whether users can reset column widths to their default values.
AllowScrollingOnDrag { get; set; } Gets or sets whether the view scrolls automatically when a dragged element approaches its edge.
AllowSorting { get; set; } Gets or sets whether users can sort data.
AutoExpandAllGroups { get; set; } Gets or sets whether all groups are expanded automatically.
AutoExpandDelayOnDrag { get; set; } Gets or sets the delay before a group is expanded automatically on drag-over.
AutoExpandOnDrag { get; set; } Gets or sets whether a collapsed group is expanded automatically when a dragged element hovers over it.
AutoGenerateBands { get; set; } Gets or sets whether bands are generated automatically.
AutoGenerateColumns { get; set; } Gets or sets whether columns are generated automatically based on the data source.
Bands { get; } Gets the collection of grid bands.
BandsSource { get; set; } Gets or sets the collection whose items are used to generate bands.
BandTemplate { get; set; } Gets or sets the template used to create a band for each item in BandsSource.
BestFitMode { get; set; } Gets or sets how the best-fit column width is calculated.
CellTemplate { get; set; } Gets or sets the default template used to display cell content when a column defines no own template.
ClipboardCopyHeaders { get; set; } Gets or sets whether column headers are copied to the clipboard along with cell values.
ColumnFilterButtonDisplayMode { get; set; } Gets or sets when the column filter buttons are displayed.
ColumnFilterPopupMode { get; set; } Gets or sets the type of the column filter popup.
ColumnMenu { get; set; } Gets or sets the context menu invoked for column headers.
Columns { get; } Gets the collection of grid columns.
ColumnsSource { get; set; } Gets or sets the collection whose items are used to generate columns.
ColumnTemplate { get; set; } Gets or sets the template used to create a column for each item in ColumnsSource.
Commands { get; } Gets the grid's commands.
ExtendScrollbarToFixedColumns { get; set; } Gets or sets whether the horizontal scrollbar extends under the fixed columns.
FilterPanelDisplayMode { get; set; } Gets or sets when the filter panel is displayed.
FilterPanelText { get; } Gets the text displayed in the filter panel.
FixedColumnSeparatorWidth { get; set; } Gets or sets the width of the separator marking fixed columns.
FixedLeftColumnWidth { get; } Gets the total width of columns fixed to the left edge.
FixedRightColumnWidth { get; } Gets the total width of columns fixed to the right edge.
FocusedColumn { get; set; } Gets or sets the focused column.
FocusedRowIndex { get; set; } Gets or sets the index of the focused row.
GroupCount { get; set; } Gets or sets the number of leading sorted columns used to group data.
HeaderDropIndicatorWidth { get; set; } Gets or sets the width of the indicator shown between headers while a column is dragged.
HeaderPanelMinHeight { get; set; } Gets or sets the minimum height of the column header panel.
IsFilterPanelVisible { get; } Gets whether the filter panel is currently displayed.
NavigationMode { get; set; } Gets or sets whether keyboard navigation moves focus between cells or between rows.
RowCellMenu { get; set; } Gets or sets the context menu invoked for data cells.
RowDragMode { get; set; } Gets or sets whether rows are dragged by the row itself or by a drag handle.
RowIndicatorWidth { get; set; } Gets or sets the width of the row indicator.
SerializationInfo { get; } Gets the serialization information for the grid.
ShowAutoFilterRow { get; set; } Gets or sets whether the auto-filter row is displayed.
ShowBands { get; set; } Gets or sets whether band headers are displayed.
ShowBandSeparators { get; set; } Gets or sets whether separators between band headers are displayed.
ShowColumnHeaders { get; set; } Gets or sets whether the column header panel is displayed.
ShowColumnMenuFixedItem { get; set; } Gets or sets whether the fixed-column item is displayed in the column header context menu.
ShowConditionInAutoFilterRow { get; set; } Gets or sets whether the auto-filter row displays the applied filter condition.
ShowGroupedColumns { get; set; } Gets or sets whether grouped columns remain visible among the data columns.
ShowGroupPanel { get; set; } Gets or sets whether the group panel is displayed.
ShowHorizontalLines { get; set; } Gets or sets whether horizontal grid lines are displayed.
ShowRowIndicator { get; } Gets whether the row indicator is displayed.
ShowTotalSummaries { get; set; } Gets or sets whether the total summary footer is displayed.
ShowVerticalLines { get; set; } Gets or sets whether vertical grid lines are displayed.
TotalSummaries { get; } Gets the collection of total summary items calculated across all rows.
UsePlatformRowDragDrop { get; set; } Gets or sets whether the platform drag-and-drop is used when dragging rows.
VisibleRowCount { get; } Gets the number of currently visible rows.
event AutoGeneratedColumns Occurs after columns are generated automatically from the data source.
event AutoGeneratingColumn Occurs when a column is about to be generated automatically. Cancel the event to prevent the column from being generated.
event CellValueChanged Occurs after a cell value has been changed.
event CellValueChanging Occurs when a user modifies a cell value in an editor, before the change is committed.
event CompleteDragDrop Occurs after a drag-and-drop operation is completed.
event CustomColumnDisplayText Occurs when the display text of a cell is needed. Set the DisplayText property to customize the text.
event CustomColumnGroup Occurs when two rows are compared during grouping. Set the Result property to indicate whether the rows belong to the same group.
event CustomColumnSort Occurs when two rows are compared during sorting. Set the Result property to implement custom sorting.
event CustomGroupValueDisplayText Occurs when the display text of a group row value is needed. Set the DisplayText property to customize the text.
event CustomRowFilter Occurs when a row is filtered. Set the Visible property to show or hide the row.
event CustomSummary Occurs when a summary value is calculated. Set the SummaryValue property to implement a custom summary.
event CustomUnboundColumnData Occurs when the value of an unbound column cell is requested or committed. Set the Value property to provide the value.
event DragOver Occurs while a dragged row is over the grid. Set the Effects and DropPosition properties to customize the drop operation.
event Drop Occurs when a dragged row is dropped over the grid. Handle the event to perform a custom drop operation.
event HiddenEditor Occurs after an editor has been closed.
event RowClick Occurs when a row is clicked.
event SelectionChanged Occurs when the row selection changes.
event ShowingEditor Occurs before an editor is activated for a cell. Cancel the event to prevent editing.
event ShownEditor Occurs after an editor has been activated for a cell.
event StartDrag Occurs when a row drag operation starts. Set the Effects and Data properties to customize the drag operation.
event ValidateCellValue Occurs when a cell value is validated. Set the ErrorContent property to indicate an error.
override BeginDataUpdate()
BestFit(…) Sets the width of the specified column to best fit its content.
BestFitAllColumns() Sets the widths of all columns to best fit their content.
CollapseAllGroups() Collapses all group rows.
CollapseGroupRow(…) Collapses the group row at the specified index.
override CommitEditing()
ExpandAllGroups() Expands all group rows.
ExpandGroupRow(…) Expands the group row at the specified index.
ExportToImages(…) Exports the grid to image files saved in the specified directory.
ExportToPdf(…) Exports the grid to the specified file in PDF format. (2 methods)
ExportToXlsx(…) Exports the grid to the specified file in XLSX format. (2 methods)
FindRowByDisplayText(…) Finds the first row whose cell display text in the specified field equals the specified text. Returns InvalidRowIndex if no row is found. (2 methods)
FindRowByItem(…) Finds the row that corresponds to the specified data source item. Returns InvalidRowIndex if the item is not found.
FindRowByValue(…) Finds the first row whose cell value in the specified field equals the specified value. Returns InvalidRowIndex if no row is found. (2 methods)
GetCellDisplayText(…) Gets the display text of the cell at the intersection of the specified row and the column bound to the specified field. (2 methods)
GetCellValue(…) Gets the value of the cell at the intersection of the specified row and column. (2 methods)
GetGroupChildRowCount() Gets the number of top-level group rows.
GetGroupChildRowCount(…) Gets the number of child rows of the group row at the specified index.
GetGroupChildRowIndex(…) Gets the index of the child row at the specified position within the group row at the specified index. (2 methods)
GetGroupRowValue(…) Gets the value of the group row at the specified index.
GetParentRowIndex(…) Gets the index of the parent group row of the row at the specified index.
GetRowIndexBySourceItemIndex(…) Gets the index of the row that corresponds to the data source item at the specified index.
GetRowIndexByVisibleRowIndex(…) Gets the index of the row at the specified visible index.
GetRowLevel(…) Gets the nesting level of the row at the specified index.
GetSelectedRowIndexes() Gets the indexes of the selected rows.
GetSourceItem(…) Gets the item from the data source at the specified index.
GetSourceItemByRowIndex(…) Gets the data source item that corresponds to the row at the specified index.
GetSourceItemByVisibleRowIndex(…) Gets the data source item that corresponds to the row at the specified visible index.
GetSourceItemIndexByRowIndex(…) Gets the data source index of the row at the specified index.
GetSourceItemIndexByVisibleRowIndex(…) Gets the data source index of the row at the specified visible index.
GetSourceItemValue(…) Gets the value of the specified column's field for the data source item at the specified index. (2 methods)
GetTotalSummaryValue(…) Gets the calculated value of the specified total summary.
GetVisibleRowIndexByRowIndex(…) Gets the visible index of the row at the specified index.
GetVisibleRowIndexBySourceItemIndex(…) Gets the visible index of the row that corresponds to the data source item at the specified index.
IsGroupRow(…) Determines whether the row at the specified index is a group row.
IsGroupRowExpanded(…) Determines whether the group row at the specified index is expanded.
IsRowSelected(…) Determines whether the row at the specified index is selected.
MoveNextCell() Moves focus to the next cell.
MoveNextRow() Moves focus to the next row.
MovePrevCell() Moves focus to the previous cell.
MovePrevRow(…) Moves focus to the previous row, optionally allowing focus to move to the auto-filter row.
PopulateColumns() Creates columns based on the data source.
RefreshData() Re-reads the data source and refreshes the grid's content.
RefreshRow(…) Refreshes the visible cells of the row at the specified index.
ResetColumnWidth() Resets the widths of all columns to their default values.
RestoreLayout(…) Restores the grid's layout from the specified stream. (2 methods)
SaveLayout(…) Saves the grid's layout to the specified stream. (2 methods)
SelectRange(…) Selects all rows between the specified start and end row indexes.
SelectRow(…) Selects the row at the specified index.
SetCellValue(…) Sets the value of the cell at the intersection of the specified row and column. (2 methods)
UnselectRow(…) Removes the selection from the row at the specified index.
const InvalidRowIndex Represents an invalid row index.

See Also