Hello, I have a datetimepicker on a toolstripbox. Filtering works fine. I created a button to reset datagridview but it doesn't work. Here's my code:
And a screenshot:Code:Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim resetBtn = New Button With {.Text = "S", .Width = 20} Dim dtp = New DateTimePicker With {.Format = DateTimePickerFormat.Short, .Width = 80} 'TODO: This line of code loads data into the 'MakbuzDataSet.makbuzT' table. You can move, or remove it, as needed. Me.MakbuzTTableAdapter.Fill(Me.MakbuzDataSet.makbuzT) MakbuzTDataGridView.Dock = DockStyle.Bottom Me.SavePending = True AddHandler dtp.ValueChanged, AddressOf DateTimePicker1_ValueChanged FillByTest08ToolStrip.Items.Add(New ToolStripControlHost(dtp)) FillByTest08ToolStrip.Items.Add(New ToolStripControlHost(resetBtn)) End Sub Private Sub resetBtn(sender As Object, e As EventArgs) MakbuzTBindingSource.Filter = "" MakbuzTDataGridView.DataSource = MakbuzTBindingSource MakbuzTBindingNavigator.BindingSource = MakbuzTBindingSource MakbuzTBindingSource.RemoveFilter() End Sub
I'm using visual studio 2012




Reply With Quote
