The cell-oriented Grid control is a very efficient display engine for tabular data that can be customized down to the cell level. It does not make any assumptions about the structure of the data. It can be used in a virtual manner where the data is provided on demand in real time, or it can be used in a manner where the Grid control maintains the data within its own internal structures. The Grid control supports frozen rows and columns; Excel-like formulas; covered cells; various cell-control types; copy–paste; both row selections and cell-range selections; hidden rows and columns; and virtually an unlimited number of rows and columns.
There are two modes for populating the Grid control with data (cell values and the required cell styles). You can use its internal data storage or provide the data on demand through virtualization. To use the Grid control’s internal data storage, you can simply set the cell styles using the Grid indexer. To configure the Grid control in Virtual mode, you need to dynamically provide data to the grid through an event, which means that the grid does not store any data in its internal data structures. A virtual grid can display millions of rows as easily as it displays a dozen. The grid also exposes a second event that lets you save changes made through the grid’s UI back to the external data source.
The Grid control supports styles to change the appearance of an individual or a group of cells, rows and columns. Common style properties include options to change background color, text color, font, alignment, wrap text mode, orientation, border and various cell formats including date-time, currency, numeric and text formats, Excel-like cell comments, etc. You can apply a single background across multiple cells using the cell spanning feature.
The Grid control supports several cell types including text box, combo box, check box, button, numeric spin box, drop-down list, embedded grid cells, and editor types like masked edit, double edit, integer edit, percent edit, and date-time edit. In addition, you can place any WPF control or any custom control inside a cell using the DataTemplate cell type.
Covered cells allow you to treat a rectangular collection of cells as a single cell. A covered cell is treated as a normal cell to which you can apply all the usual style properties.
The Grid control provides various row and column options such as interactive column rearranging with drag-and-drop operations, hide or unhide a range of rows and columns, resize the row heights and column widths to fit the cell contents, and options to fix rows and columns to the left, right, top, or bottom of the Grid control that are similar to freeze panes in Excel.
The Grid control offers different kinds of selection modes such as row only, column only, cell only, or any combination of rows, columns, and cells. Selection rendering is done on a separate layer from the grid rendering, thereby providing superior performance.
The Grid control provides extensive support for keyboard handling, including all the popular Excel keyboard shortcuts. Arrow keys—move the current cellCTRL+Arrow keys—moves to first/last, row/columnSHIFT+Arrow keys—selects the cellsDELETE—delete the cell contentsPAGE UP and PAGE DOWN—scrolls the grid by pagesF2—activate or deactivate the current cellF4+ALT—Drop-down or close-up the pop-up in a cellCTRL+X, CTRL+V, CTRL+C, INSERT—common clipboard operations. All keyboard operations are customizable.
The undo and redo commands add immeasurable value to the user interface of any application. The Grid control offers complete support for multilevel undo and redo operations. Any changes to the grid are saved in an undo list to perform subsequent undo and redo operations when needed. A group of such actions, called a ‘transaction,’ can be rolled back in a single step.
The Grid control supports Excel-like formulas in each cell. It comes with an extensive formula function library that supports more than 360 built-in formulas. You can also easily add custom functions to its function library.
The Grid control supports Excel-like user interaction features such as cell range drag-and-drop, auto-fill selections, and visual indicators to show hidden rows and columns. It also provides an Excel-like current cell for editing. Content in a rich-text-box cell can be copied and pasted from the Grid control to Microsoft Excel. The following clipboard operations are supported: Cutting, copying, or pasting text only.Cutting, copying, or pasting text and styling. Skipping a current cell while performing clipboard operations. Copying cells from the Grid control to Microsoft Excel while inheriting basic formatting like foreground, background, font style and size, and formulas.
The import feature allows you to import an Excel workbook to a grid while preserving the workbook’s look and feel. The following can be imported: An entire spreadsheet.Formulas, styles, and conditional formats.Frozen panes, backgrounds, and foregrounds.Comments.
The Grid control provides excellent clipboard support that allows users to copy and paste grid cells. You can even copy and paste cell contents into Excel with the styles and formulas intact.
The Grid control provides inherent support for exporting its content to an Excel file (.xls and .xlsx format) and to .csv files. Formatting of rich content is also preserved when exporting to Excel.
The Grid control provides built-in support for the Print and Print Preview dialogs. These dialogs have options for selecting paper size, zooming in on content, selecting print color, and more.
GridControl supports CodedUITesting automation .You can record or assert the properties of specific cell with CodedUITestBuilder.