locked
Add a button on DataGridView cell RRS feed

  • Question

  • Hi guys !
    I'm asking if is possible insert a different button in a DataGridView like the example picture.


    i try with this lines, i can show the button but when i click on the button, the function doesn't start

    $button6 = New-Object System.Windows.Forms.DataGridViewButtonColumn 
    $button6.HeaderText = "START_FUNCTION"
    $button6.UseColumnTextForButtonValue = $true
    $button6.Text = "SELECT"
    $button6.Width = 190
    $button6.HeaderText
    $button6.Add_CellMouseClick({SELECTEDROWS})
    $dataGridView.columns.Add($button6)


    Sunday, May 21, 2017 2:14 PM

Answers

  • You cannot add an event to a cell button.  Use the "Cell" methods on the DataGridView to detect change.

    $datagridview.Add_CellMouseClick({SELECTEDROWS})


    \_(ツ)_/

    • Marked as answer by Ramses147 Sunday, May 21, 2017 4:27 PM
    Sunday, May 21, 2017 3:28 PM