Completed
Last Updated: 01 Jul 2019 15:04 by ADMIN
Release R3 2019 (LIB 2019.2.708)
Comparto
Created on: 20 Jun 2019 06:02
Category: GridView
Type: Bug Report
0
RadGridView: when Deferred search is enabled, pressing the clear button in the search box doesn't clear the search results

UI for WinForms R2 2019 SP1 (version 2019.2.618)

June 19, 2019

RadGridView

NEW
  • New property inside GridViewSearchRowInfo: DeferredSearch. Gets or sets a value indicating whether grid will wait until enter key is pressed before it starts a search.

 

 

I have implemented this and it is exactly what I want and need, Thank you! 
However I thought I might point out that when you tab out it doesn't implement the search, only when you press enter.

And when you press the X to clear the search it clears the text box but not the search. the count of found and the highlighted finds remain 

1 comment
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 20 Jun 2019 12:19
Hello, David,

I am glad that the newly introduced deferred search functionality is useful for your scenario.

Indeed, when you perform some searching and press the "X" button in the search text box, the text is cleared, but the searching is not reset. I confirm that this is an issue with the deferred search functionality.

I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to clear the search result as follows:

Private Sub RadGridView1_ViewCellFormatting(sender As Object, e As CellFormattingEventArgs)
    Dim searchCell As GridSearchCellElement = TryCast(e.CellElement, GridSearchCellElement)
    If searchCell IsNot Nothing Then
 
        RemoveHandler searchCell.SearchTextBox.ClearButton.Click , AddressOf ClearButton_Click
        AddHandler searchCell.SearchTextBox.ClearButton.Click , AddressOf ClearButton_Click
 
    End If
End Sub
 
Private Sub SearchTextBox_KeyUp(sender As Object, e As KeyEventArgs)
    Dim searchBox As GridSearchCellTextBoxElement = TryCast(sender, GridSearchCellTextBoxElement)
    If e.KeyData = Keys.Tab AndAlso Me.RadGridView1.MasterView.TableSearchRow.DeferredSearch Then
        Me.RadGridView1.MasterView.TableSearchRow.Search(searchBox.Text)
    End If
End Sub

As to the search on Tab key, it can easily be achieved by using the following code snippet:

Private Sub RadGridView1_ViewCellFormatting(sender As Object, e As CellFormattingEventArgs)
    Dim searchCell As GridSearchCellElement = TryCast(e.CellElement, GridSearchCellElement)
    If searchCell IsNot Nothing Then
        RemoveHandler searchCell.SearchTextBox.KeyUp, AddressOf SearchTextBox_KeyUp
        AddHandler searchCell.SearchTextBox.KeyUp, AddressOf SearchTextBox_KeyUp
    End If
End Sub
 
Private Sub SearchTextBox_KeyUp(sender As Object, e As KeyEventArgs)
    Dim searchBox As GridSearchCellTextBoxElement = TryCast(sender, GridSearchCellTextBoxElement)
    If e.KeyData = Keys.Tab AndAlso Me.RadGridView1.MasterView.TableSearchRow.DeferredSearch Then
        Me.RadGridView1.MasterView.TableSearchRow.Search(searchBox.Text)
    End If
End Sub
   
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.