请问Winform中的DataGridView控件有这样的属性或事件吗?绑定数据记录数为空时,我要弹出提示。
我是想要控件自带的事件,不想查出数据再判断。
我找了一下找不到。

解决方案 »

  1.   

    this.dataGridView1.Rows[i].Cells[i].Value = null;
      

  2.   

    自己写个控件 继承datagridview啊
      

  3.   

    绑定的table,rows.count<1 
    messagebox.show()
      

  4.   


    DataGridView1.DataSource = New DataTable("学生信息")
        Private Sub DataGridView1_DataBindingComplete(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete
            If (DataGridView1.RowCount = 0) Then
                MessageBox.Show("绑定数据为空!")
            End If
        End Sub在DataBindingComplete事件中判断就可以了。