-1
我需要按日期搜索DataGridView。如果我在文本框中輸入2/11/2017
,我希望網格向我顯示包含此日期的行。 DataGridView中的日期列名爲AppointmentDate
,並在SQL Server中創建。此欄的類型僅爲日期。使用文本框搜索VB
我看到了這個,但我使用的是實體框架模型,我不知道如何實現它。
dgvPacientet.CurrentCell = Nothing
Dim found As Boolean = False
For Each row As DataGridViewRow In dgvPacientet.Rows
row.Visible = row.Cells("Dt_terminit").Value = txtData.Text
If row.Visible Then found = True
Next
If Not found Then MsgBox("Item not found")`
它說與貨幣經理的位置關聯的行不能被隱藏。 – Rinor
YOu可能需要先清除當前單元格...查看更新後的代碼。 –
它不讓我寫日期。我開始輸入日期,只要我輸入2,它就對我說,請輸入日期。 – Rinor