This is probably easier than what I am making it out to be. I am trying to simply insert a string from a hidden column(MachID) within a datagridview to a buttoncell text value. I cant seem to get a hold of the button cell ".text' property no matter how I cast things. This code just freezes.
Code:
Dim BtnCol As New DataGridViewButtonColumn
With BtnCol
.HeaderText = "Select"
.Name = "BtnCol"
.UseColumnTextForButtonValue = True
End With
.Columns.Add(BtnCol)
Code:
For Each DGVRow As DataGridViewRow In DGV_Machine.Rows
Dim BtnCell As DataGridViewButtonCell = CType(DGVRow.Cells("BtnCol"), DataGridViewButtonCell)
BtnCell.Value = DGVRow.Cells("MachID").Value.ToString
Next