DataGridView (dgr)

microsoft excel docsDataGrid (dgr) - Allows the user to display (and edit) a table of information.


Properties

AllowDropWhether the control can accept data that is dragged and dropped onto this control.
AllowUserToAddRowsGets or sets the option for the user to add rows
AllowUserToDeleteRowsGets or sets the option for the user to delete rows
AllowUserToOrderColumnsGets or sets the option for the user to reorder the columns
AllowUserToResizeColumnsGets or sets the option for the user to adjust the column widths
AllowUserToResizeRowsGets or sets the option for the user to adjust the row heights
AlternatingRowsDefaultCellStyleOnly for rows with odd index numbers
AutoGenerateColumnsWhen you bind a DataGridView control you can set this property to true for the column types to be automatically generated which are appropriate for the data type in the bound source.
AutoSizeColumnsModeIndicates how column widths are determined.
BackgroundColorGets or sets the color of the non-row area of the grid. This is always set to Window.
BorderStyleGets or sets the grid's border style.
CellBorderStyleGets or sets the cell border style
ClipboardCopyMode 
ColumnHeadersBorderStyle 
ColumnHeadersDefaultCellStyle 
ColumnHeadersHeight20
ColumnHeadersHeightSizeModeDisableResizing
ColumnHeadersVisibleGets or sets a value indicating whether the column headers a table are visible.
Columns 
ContextMenuStrip 
CurrentCellGets or sets which cell has the focus. Not available at design time.
CurrentRowIndexGets or sets index of the selected row.
DataMemberGets or sets the specific list in a DataSource for which the System.Windows.Forms.DataGrid control displays a grid.
DataSourceGets or sets the data source that the grid is displaying data for.
DefaultCellStyle 
EditMode 
EnableHeadersVisibleStyles 
FirstVisibleColumnGets the index of the first visible column in a grid.
FlatModeGets or sets a value indicating whether the grid displays in flat mode.
ForeColorOverridden. Gets or sets the foreground color (typically the color of the text) property of the System.Windows.Forms.DataGrid control.
GenerateMember 
GridColor 
GridLineColorGets or sets the color of the grid lines.
GridLineStyleGets or sets the line style of the grid.
HeaderBackColorGets or sets the background color of all row and column headers.
HeaderFontGets or sets the font used for column headers.
HeaderForeColorGets or sets the foreground color of headers.
LinkColorGets or sets the color of the text that you can click to navigate to a child table.
LinkHoverColorGets or sets the color a link changes to when the mouse pointer moves over it.
Margin 
MultiSelect 
ParentRowsBackColorGets or sets the background color of parent rows.
ParentRowsForeColorGets or sets the foreground color of parent rows.
ParentRowsLabelStyleGets or sets the way parent row labels are displayed.
ParentRowsVisibleGets or sets a value indicating whether the parent rows of a table are visible.
PreferredColumnWidthGets or sets the default width of the grid columns in pixels.
PreferredRowHeightGets or sets the preferred row height for the System.Windows.Forms.DataGrid control.
ReadOnlyGets or sets a value indicating whether the grid is in read-only mode.
RowHeadersBorderStyle 
RowHeadersDefaultCellStyle 
RowHeadersVisibleGets or sets a value that specifies whether row headers are visible.
RowHeadersWidthGets or sets the width of row headers.
RowHeadersWidthSizeMode 
RowsDefaultCellStyle 
ScrollBarsIndicates the type of scroll bars that are displayed: None, Horizontal, Vertical or Both. The scroll bars will only appear when they are needed and not all the time. If you want them to appear all the time then you must derive you own class.
SelectionModeFullRowSelect
ShowCellErrors 
ShowCellToolTipsFalse
ShowEditingIcon 
ShowRowErrors 
Size 
StandardTabSetting this to True prevents the tab key from being used to move the focus to the next cell.
TabIndex 
TabStop 
Tag 
UseWaitCursor 
VirtualMode 
Visible 

Methods

BeginEditAttempts to put the grid into a state where editing is allowed.
BeginInitBegins the initialization of a System.Windows.Forms.DataGrid that is used on a form or used by another component. The initialization occurs at run time.
ClearSelection 
CollapseCollapses child relations, if any exist for all rows, or for a specified row.
EndEditRequests an end to an edit operation taking place on the System.Windows.Forms.DataGrid control.
EndInitEnds the initialization of a System.Windows.Forms.DataGrid that is used on a form or used by another component. The initialization occurs at run time.
ExpandDisplays child relations, if any exist, for all rows or a specific row.
GetCellBoundsOverloaded. Gets the Rectangle that specifies the four corners of a cell.
GetCurrentCellBoundsGets a Rectangle that specifies the four corners of the selected cell.
HitTestOverloaded. Gets information about the System.Windows.Forms.DataGrid control at a specified point on the screen.
IsExpandedGets a value that indicates whether a specified row's node is expanded or collapsed.
IsSelectedGets a value indicating whether a specified row is selected.
ItemOverloaded. Gets or sets the value of a specified cell.
NavigateBackNavigates back to the table previously displayed in the grid.
NavigateToNavigates to the table specified by row and relation name.
ResetAlternatingBackColorResets the AlternatingBackColor property to its default color.
ResetBackColorOverridden. Resets the BackColor property to its default value.
ResetForeColorOverridden. Resets the ForeColor property to its default value.
ResetGridLineColorResets the GridLineColor property to its default value.
ResetHeaderBackColorResets the HeaderBackColor property to its default value.
ResetHeaderFontResets the HeaderFont property to its default value.
ResetHeaderForeColorResets the HeaderForeColor property to its default value.
ResetLinkColorResets the LinkColor property to its default value.
ResetSelectionBackColorResets the SelectionBackColor property to its default value.
ResetSelectionForeColorResets the SelectionForeColor property to its default value.
SelectOverloaded. Selects a specified row.
SetDataBindingSets the DataSource and DataMember properties at run time.
UnSelectUnselects a specified row.

Events

CellClickOccurs when any part of a cell is clicked by using the mouse. This is required if selection has been removed from the control and you need to know when focus comes back to this control.
CellBeginEdit 
CellEndEdit 
CellEnterOccurs when the current cell changes or when the control receives input focus.
CellFormattingOccurs when the contents of a cell need to be formatted for display.
CellValidatedOccurs after the cell has finished validating.
CellValidatingOccurs when a cell loses input focus, enabling content validation.
CurrentCellChangedOccurs when the CurrentCell property changes. This is fired when both arrow keys or mouse are used.
EditingControlShowingOccurs when a control for editing a cell is showing.
RowEnterOccurs when the current row is changed
SelectionChangedOccurs when the current selection changes.
TextChanged 



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext