RadGridView: Databind to or manipulate the FullTextSearch

2 Answers 670 Views
GridView
Martin
Top achievements
Rank 2
Iron
Iron
Iron
Martin asked on 16 Jun 2021, 09:04 AM | edited on 16 Jun 2021, 11:39 AM

How the heck do i databind or manipulate the FullTextSearch Text ??

I've tried doing perfectly normal / sane / obvious databinding in XAML like this: 

<telerik:RadGridView TextSearch.Text="{Binding MyTextProperty}">

but that doesn't work - maybe because its not the correct property -- can't find it in documentation or as property on the radGridView instance..

I've also tried figuring out the binding example from this Forum called https://www.telerik.com/forums/bind-full-text-search-to-custom-textbox but failed to do so.. 

Why is the FullTextSearch String property not exposed in a normal behavior like with a DependencyProperty ???????

Why is this so hard ?

Why are the SearchPanel hardcoded instead of exposing a customizable panel ??

eg: If i want to add a button that clears all Search Filters , i need to make ugly hacks :(

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Top achievements
Rank 2
Iron
Iron
Iron
answered on 16 Jun 2021, 12:32 PM | edited on 16 Jun 2021, 12:33 PM

found the answer by pure luck ...

https://www.telerik.com/forums/radgridviewcommands-searchbytext

using this obscure command design pattern, you are able to change the Search-Text in the RadGridView:

public void DoSearch(string text)
{
     var grid = /* reference to RadGridView control */;
     var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
     searchBytextCommand.Execute(text, grid);
}

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 16 Jun 2021, 10:41 AM

Hello.

If you use mvvm and implicit styles my example will be helpful.

The key to Search Text implicit style is to go to telerik:LocalizationManager.ResourceKey="GridViewSearchPanelTopText" and check it out.

 

 

Martin
Top achievements
Rank 2
Iron
Iron
Iron
commented on 16 Jun 2021, 11:41 AM | edited

Thanks
I'd like to create my own SearchPanel with a Textbox myself - because i want more controls for the GridView, eg: Clear Filter button + various checkboxes..

The Example you've made changes the Textblock in front of the TextBox.

I want to access the Full Text Search textbox / string property.
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
commented on 17 Jun 2021, 12:31 AM

I'm glad you found it.
If you want your own custom textbox, you can add controls and functions in the style :)
Tags
GridView
Asked by
Martin
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin
Top achievements
Rank 2
Iron
Iron
Iron
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Share this question
or