June 19, 2019
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
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