Private Sub dgAppliances_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgAppliances.CellContentClick If e.ColumnIndex <> 2 Then Exit Sub Else If Me.dgAppliances.RowCount = 20 Then MsgBox("Maximum of 20 appliances only.") Else dgvAppsRowNo += 1 Me.dgAppliances.Rows.Add() Me.dgAppliances.Rows(dgvAppsRowNo).Cells(0).Value = dgvAppsRowNo + 1 Dim cell As DataGridViewButtonCell = dgAppliances.Rows(dgvAppsRowNo).Cells(2) cell.Value = New DataGridTextBoxColumn() cell.ReadOnly = True End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)