DataGridViewEditingControlShowingEventArgs DataGridViewEditingControlShowingEventArgs DataGridViewEditingControlShowingEventArgs DataGridViewEditingControlShowingEventArgs Class

Definition

Provides data for the EditingControlShowing event.

public ref class DataGridViewEditingControlShowingEventArgs : EventArgs
public class DataGridViewEditingControlShowingEventArgs : EventArgs
type DataGridViewEditingControlShowingEventArgs = class
    inherit EventArgs
Public Class DataGridViewEditingControlShowingEventArgs
Inherits EventArgs
Inheritance
DataGridViewEditingControlShowingEventArgsDataGridViewEditingControlShowingEventArgsDataGridViewEditingControlShowingEventArgsDataGridViewEditingControlShowingEventArgs

Examples

The following code example illustrates how to handle this event to change the BackColor property of the current cell. To run this example, paste the code into a form that contains a DataGridView named dataGridView1 and ensure that the EditingControlShowing event is associated with the event handler.

private void dataGridView1_EditingControlShowing(object sender, 
    DataGridViewEditingControlShowingEventArgs e)
{
    e.CellStyle.BackColor = Color.Aquamarine;
}
Private Sub dataGridView1_EditingControlShowing(ByVal sender As Object, _
    ByVal e As DataGridViewEditingControlShowingEventArgs) _
    Handles dataGridView1.EditingControlShowing

    e.CellStyle.BackColor = Color.Aquamarine

End Sub

Remarks

Handle the EditingControlShowing event to perform custom initialization of the editing control when a cell enters edit mode. To customize the display characteristics of the control, set the properties of the object returned by the CellStyle property rather than setting the properties of the control returned by the Control property.

For more information about handling events, see NIB: Consuming Events.

Constructors

DataGridViewEditingControlShowingEventArgs(Control, DataGridViewCellStyle) DataGridViewEditingControlShowingEventArgs(Control, DataGridViewCellStyle) DataGridViewEditingControlShowingEventArgs(Control, DataGridViewCellStyle) DataGridViewEditingControlShowingEventArgs(Control, DataGridViewCellStyle)

Initializes a new instance of the DataGridViewEditingControlShowingEventArgs class.

Properties

CellStyle CellStyle CellStyle CellStyle

Gets or sets the cell style of the edited cell.

Control Control Control Control

The control shown to the user for editing the selected cell's value.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See Also