Results 1 to 12 of 12

Thread: Removing date filter

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Removing date filter

    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:

    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
    And a screenshot:

    Name:  xw9c.png
Views: 394
Size:  14.3 KB

    I'm using visual studio 2012
    Last edited by nikel; Oct 26th, 2013 at 06:33 AM. Reason: I added version

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width