Unable To set row visible false of a datagridview

后端 未结 6 1633
北荒
北荒 2020-11-27 05:55

I have a DataGridView where I set DataSource:

taskerEntities te = new taskerEntities();
var OMsMasterDescriptiveIndicators = te.MyT         


        
6条回答
  •  天命终不由人
    2020-11-27 06:48

    I know this is an old topic, but an alternative solution (my code is vb.net, but I assume it would translate)

    If WO_DGV.CurrentCell.RowIndex = i Then
      'you cannot make invisible the row that is 'current'
      WO_DGV.CurrentCell = WO_DGV.Rows(i - 1).Cells("act") 
      'to get to this code I know that there is a row before i, which is why I can use i-1 as new focus
    End If
    WO_DGV.Rows(i).Visible = False 
    

提交回复
热议问题