0

情况如下:-

I binded an Id to a column in a datagrid.
and now i want to pass that Id to row click event of this Datagrid.

1.What is the row click event of Datagrid?

2.How to pass this Id to the event?

任何指导将不胜感激。

谢谢

4

1 回答 1

0

使用此示例,您可以捕获行索引和列索引

Private Sub DataGridView1_CellMouseClick(sender As [Object], e As DataGridViewCellMouseEventArgs)

    Dim cellInformation As New System.Text.StringBuilder()
    cellInformation.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex)
    cellInformation.AppendLine()
    cellInformation.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex)
    cellInformation.AppendLine()
    MessageBox.Show(cellInformation.ToString(), "CellMouseClick Event")
End Sub
于 2012-11-23T08:10:11.030 回答