DataGridView和DateTimePicker
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
Dim i As Integer
For i = 0 To DataGridView1.Rows.Count - 1
If DataGridView1.Rows(i).Cells("使用日期").Value <> CDate(DateTimePicker1.Text) Then
DataGridView1.Rows(i).Visible = False
End If
Next
End Sub
请问,我这样做,为什么老是报错!是不是我的语法出错了。 ado.net datagridview datetimepicker vb.net
[解决办法]
If DataGridView1.Rows(i).Cells("使用日期").Value.ToString() <> DateTimePicker1.Text Then