【问题标题】:selecting full row of datagridview in vb.net on form_Load [closed]在form_Load上的vb.net中选择整行datagridview [关闭]
【发布时间】:2010-03-01 17:47:48
【问题描述】:

如何在 form_Load 上的 vb.net 中选择完整的第一行 datagridview

【问题讨论】:

    标签: vb.net


    【解决方案1】:

    我不确定是否所有这些行都是绝对必要的,但这应该可行:

    If MyDataGridView.RowCount > 0 Then
        MyDataGridView.ClearSelection()
        MyDataGridView.CurrentCell = Me.Rows(0).Cells(0)
        MyDataGridView.Rows(0).Selected = True
    End If
    

    啊,如果要选择整行,DataGridView的选择模式属性必须是FullRowSelect

    【讨论】:

      【解决方案2】:
      DataGrid1.Rows(0).Selected = True
      

      【讨论】:

        【解决方案3】:
        DataGridView.SelectedIndex = 0
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-12-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-06-16
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多