如何使用DataGridView
的日期范围过滤DateTimePickers
上的记录?
到目前为止,这是我的代码,但是当我点击按钮时,它什么都不做:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Consulta_DetalleBindingSource.Filter = "FECHA >= '" & DateTimePicker1.Value & "' and FECHA <= '" & DateTimePicker2.Value & "'"
End Sub
这是设置BindingSource
:
Me.Consulta_DetalleBindingSource = New System.Windows.Forms.BindingSource(Me.components)
CType(Me.Consulta_DetalleBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Consulta_DetalleBindingSource.DataMember = "Consulta_Detalle"
Me.Consulta_DetalleBindingSource.DataSource = Me.AtlánticoDataSet