RadGrid Filtermenu Customisation

1 posts, 0 answers
  1. Johan
    Johan avatar
    6 posts
    Member since:
    Aug 2017

    Posted 03 Jan 2018 Link to this post


    so im trying to add a button to the first cell in the Filtermenu with a 'Clear all filters' functionality. However i cant seem to get a handle on the first cell.

    Here's some testing that i've tried so far with various examples i've found over the internet.

    Private Sub Grid_OnItemCreated(sender As Object, e As GridItemEventArgs)
                If e.Item.ItemType = GridItemType.FilteringItem Then
                    Dim clearFilterButton = New RadButton() With {.ButtonType = RadButtonType.StandardButton,
                                                                  .Height = 22,
                                                                  .Width = 22,
                                                                  .Text = "Clear Filter",
                                                                  .ToolTip = "Clear all filters"}
                    AddHandler clearFilterButton.Click, AddressOf ClearFilterButton_Click
                    Dim grid As RadGrid = CType(sender, RadGrid)
                    Dim firstcell = grid.Controls(0)
                End If
            End Sub
            Private Sub ClearFilterButton_Click(sender As Object, e As EventArgs)
                For Each grid As RadGrid In Controls.All().OfType(Of RadGrid)()
                    grid.MasterTableView.FilterExpression = String.Empty
            End Sub


    I cant seem to get it to do anything at all tho. Even just trying to hide the Filtermenu does not seem to do anything. And yes the event is firing, it is triggered in the basepage load. Is this the way to add a button to a filtermenu? Or is there a better way?








Back to Top