Upraviť

Zdieľať cez


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
DataGridViewEditingControlShowingEventArgs

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 how to handle events, see Handling and Raising Events.

Constructors

DataGridViewEditingControlShowingEventArgs(Control, DataGridViewCellStyle)

Initializes a new instance of the DataGridViewEditingControlShowingEventArgs class.

Properties

CellStyle

Gets or sets the cell style of the edited cell.

Control

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

Methods

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also