How to use DataGridView BeginEdit for 3 columns in vb.net

54 Views Asked by At

So I want the edit content to click first then the edit position in column 3, then I click second then the edit position in column 4, then ,then click third then the edit position in column 5. or there is another way

Please guide me

Thanks


    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        DataGridView1.DataSource = itrservice.GetLoadStocksoutdetailMaster.ToList()
        DataGridView1.EditMode = DataGridViewEditMode.EditProgrammatically
    End Sub
 Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        If DataGridView1.Columns(e.ColumnIndex) Is DataGridView1.Columns("coledit") Then
            DataGridView1.CurrentCell = DataGridView1(3, e.RowIndex)
            DataGridView1.BeginEdit(True)
            DataGridView1.CurrentCell = DataGridView1(4, e.RowIndex)
            DataGridView1.BeginEdit(True)
            DataGridView1.CurrentCell = DataGridView1(5, e.RowIndex)
            DataGridView1.BeginEdit(True)
        End If
    End Sub

RESULT FORM IN DATAGRIDVIEW280823

RESULT FORM IN DATAGRIDVIEW280823

0

There are 0 best solutions below