Datagridview
The control replaces the DataGrid.
Control.Datagridview
Controls provideDataGrid
Controls do not have many basic and advanced functions. In addition,Datagridview
Control structure makes it more efficientDataGrid
Controls are easier to expand and customize.
The following table describesDatagridview
AndDataGrid
Controls do not provide several major functions.
Functions of the datagridview Control |
Description |
Multiple column types |
AndDataGrid Control,Datagridview Controls provide more built-in column types. These column types can meet the needs of most common solutionsDataGrid The column type in the control is easier to expand or replace. For more information, see the column type in the Windows Forms datagridview control. . |
Multiple data display modes |
DataGrid Controls are limited to displaying data from external data sources. WhileDatagridview The control displays unbound data stored in the control, data from the bound data source, or bound data and unbound data. You can alsoDatagridview Control to provide custom data management. For more information, see data display mode in the Windows Forms datagridview control. . |
Multiple methods for Custom Data Display |
Datagridview Controls provide many properties and events, and you can use them to specify the data format settings and display methods. For example, you can change the appearance of cells, rows, and columns, or replace one type of data with another type of equivalent data. For more information, see data format settings in the Windows Forms datagridview control. . |
Multiple options used to change the appearance and behavior of cells, rows, columns, and headers |
Datagridview Controls allow you to use grid components in multiple ways. For example, you can freeze rows and columns to prevent them from rolling. You can hide rows, columns, and headers. You can change the size of rows, columns, and headers; provides tooltip and shortcut menus for cells, rows, and columns. |
RetainedDataGrid
Controls for backward compatibility and special needs. However, almost all purposes should be usedDatagridview
Control.DataGrid
AndDatagridview
The only function not provided by the control is to display information in two related tables hierarchically in one control. You must use twoDatagridview
Controls display information in two tables with a master/detail relationship.
Upgrade to the datagridview Control
If existing applications are not customized in the simple data binding schemeDataGrid
You can use the new control to replace the old one. Both controls use the standard Windows form data binding structure. ThereforeDatagridview
Controls display bound data without additional configuration. You may want to use the improved data binding function. In fact, you can bind data to bindingsource.
And then bind the componentDatagridview
Control. For more information, see bindingsource Components
.
BecauseDatagridview
The control has a new structure, so it does not exist.DataGrid
CustomDatagridview
The direct conversion path of the control. However, because the new control provides built-in functions, manyDataGrid
CustomDatagridview
Controls are unnecessary. If you haveDataGrid
Control creates a Custom column type and you want to use these typesDatagridview
Control, you must use the new structure to implement them again.