Without looking at any code it is impossible to give a specific reply, but what I think you need to do is to create a general delegate that will sort your data based on a keyword and then add the delegate when you create your button, sort of like this
Private Sub ClickHandler(ByVal sender as Object, ByVal e as System.EventArgs)
End Sub
Dim btnFilter as New Button
btnFilter.Text = "Filter"
AddHandler btnFilter.Click ,AddressOf ClickHandler
I hope this is what you were after
Happy Coding