vb System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs.RowIndex类(方法)实例源码

下面列出了vb System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs.RowIndex 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Windows.Form   
Public Sub dataGridView1_RowContextMenuStripNeeded( _
    ByVal sender As Object, _
    ByVal e As DataGridViewRowContextMenuStripNeededEventArgs) _
    Handles dataGridView1.RowContextMenuStripNeeded

    Dim dataGridViewRow1 As DataGridViewRow = _
    dataGridView1.Rows(e.RowIndex)

    toolStripMenuItem1.Enabled = True

    ' Show the appropriate ContextMenuStrip based on the employees title.
    If dataGridViewRow1.Cells("Title").Value.ToString() = _
        "Sales Manager" OrElse _
        dataGridViewRow1.Cells("Title").Value.ToString() = _
        "Vice President, Sales" Then

        e.ContextMenuStrip = managerMenuStrip
    Else
        e.ContextMenuStrip = employeeMenuStrip
    End If

    contextMenuRowIndex = e.RowIndex
End Sub


问题


面经


文章

微信
公众号

扫码关注公众号