Assembly: CleanCode.DataGridViewControls (in CleanCode.DataGridViewControls.dll) Version: 22.214.171.124 (1.2.03)
public class ExtendedDataGridView : DataGridView, IDisplayCommands
Public Class ExtendedDataGridView _ Inherits DataGridView _ Implements IDisplayCommands
public ref class ExtendedDataGridView : public DataGridView, IDisplayCommands
This control builds upon the excellent base developed by Chris McGrath and discussed in his article Extending the DataGridView. I have noted in the code the additional enhancements I have made available through CleanCode. Click on the thumbnail at right for a screenshot of the ExtendedDataGridView.
The additional features provided by the ExtendedDataGridView are shown below. Many of these are available from the keyboard shortcuts indicated. Many of them are also available from a context menu that is activated by right-clicking any header cell in the grid.
- Quick-Find (Control+/)
Displays a search panel for you to enter a search string. The results are shown instantaneously on each keystroke. Quick-find is only available once you explicitly sort any column, and only operates on that column.
- Quick-Filter (Control+')
Displays a filter panel for you to enter a filter string. To activate the filter press return in the text field or select the Apply button. (Unlike Quick-Find, Quick-Filter does not respond to each keystroke.) Erase the applied filter by selecting the erase button to filter the DataGridView on a column.
- Mask columns by keystroke(Control+Alt+[1-9])
Show/hide any of the first nine columns if enabled via the AllowAddRemoveColumns property. The column headers are numbered for reference upon pressing the Control and Alt keys.
- Sort columns by keystroke (Control+Shift+[1-9])
Sort by any of the first nine columns. The column headers are numbered for reference upon pressing the Control and Alt keys.
- Adjust column widths (Alt+=)
Set the columns to fit the headers or to fit the data. Repeated presses toggle between the two styles. Since columns could be arbitrarily wide, you may limit the columns when fitting to the data via the MaxColumnWidth property.
- Adjust row heights (Alt+] and Alt+[)
Increase or decrease the height of all rows in the DataGridView.
- Adjust date formatting
Select any of more than a dozen standard date formats, applied globally to any fields that contain a date or time.
- Reveal column data type
When you enter column-handling mode (holding Ctrl+Alt or Ctrl+Shft) to reveal column numbers for sorting or hiding columns, this also reveals the data types of the columns as tooltips on the header cells.
- Copy field names (Ctrl+;)
As a convenience for copying field names from a grid, select one or more cells in the grid, then invoke Ctrl+;. The field names (displayed column headers) are copied to the clipboard in a comma-separated list, ready for pasting into a select list, for example.
- Export result set
Export to Excel (if available) or CSV (if enabled via the ShowCsvExport property). Depending upon the setting of the ExportVisibleColumnsOnly property, this may export all columns or just the visible ones. This is available from the context menu only.
- Alt-key navigation suppression
Provides an option to suppress Alt+UpArrow and Alt+DownArrow navigation. The default behavior is that they operate the same as UpArrow and DownArrow without the Alt key. You may suppress this behavior by enabling the SuppressAltNavigation property.
Since CleanCode 0.9.23.