Enabling and disabling a cell in a Datagridview

后端 未结 3 1051
北荒
北荒 2020-12-25 13:17

I am using a DataGridView control for displaying some data. I need to enable some data and disable some data dynamically based on some values in the grid.

Can anyone

3条回答
  •  心在旅途
    2020-12-25 13:59

    Step 1:

    type form load : -
    For i = 0 to Datagridview.columns.count -1
       if i <> 1 then //restricted columns, 'i' is Your column index
        Datagridview.Columns(i).ReadOnly = True
       end if
    Next
    

    Step 2

    type Cellbeginedit
    Datagridview.BeginEdit(True)
    

提交回复
热议问题