DataGridViewCellCancelEventArgs.ColumnIndex Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the column index of the cell that the event occurs for.
public:
property int ColumnIndex { int get(); };
public int ColumnIndex { get; }
member this.ColumnIndex : int
Public ReadOnly Property ColumnIndex As Integer
Property Value
The column index of the DataGridViewCell that the event occurs for.
Examples
The following code example illustrates the use of this property.
private void dataGridView1_CellBeginEdit(object sender,
DataGridViewCellCancelEventArgs e)
{
string msg = String.Format("Editing Cell at ({0}, {1})",
e.ColumnIndex, e.RowIndex);
this.Text = msg;
}
private void dataGridView1_CellEndEdit(object sender,
DataGridViewCellEventArgs e)
{
string msg = String.Format("Finished Editing Cell at ({0}, {1})",
e.ColumnIndex, e.RowIndex);
this.Text = msg;
}
Private Sub dataGridView1_CellBeginEdit(ByVal sender As Object, _
ByVal e As DataGridViewCellCancelEventArgs) _
Handles DataGridView1.CellBeginEdit
Dim msg As String = _
String.Format("Editing Cell at ({0}, {1})", _
e.ColumnIndex, e.RowIndex)
Me.Text = msg
End Sub
Private Sub dataGridView1_CellEndEdit(ByVal sender As Object, _
ByVal e As DataGridViewCellEventArgs) _
Handles DataGridView1.CellEndEdit
Dim msg As String = _
String.Format("Finished Editing Cell at ({0}, {1})", _
e.ColumnIndex, e.RowIndex)
Me.Text = msg
End Sub
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET