This is a migrated thread and some comments may be shown as answers.

Performance issue on full text search when grouped

1 Answer 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 29 May 2017, 08:32 AM

Hi,

We are using your RadGridView in a lot of screens.

For the first time, we have to use the full text search (ctrl F) on a grouped gridview.

In our case (300 lines grouped in 6 groups), we are facing of some performance issue (which give the grid unusable for a final user: too slow).

Do you have a recommandation or best practices for the fulltext search ?

 

The problem disapear if we do that : control the lauch of the search after a timer of 300ms.
So, we change the RadGridView property IsSearchingDeferred="True" and add the following code in the code behind of our view (named ContractDocumentsView)

01....
02. 
03.// Constructor of ContractDocumentsView
04.        public ContractDocumentsView(IServiceLocator serviceLocator)
05.        {
06.            InitializeComponent();
07. 
08.            if (DesignerProperties.GetIsInDesignMode(this))
09.            {
10.                return;
11.            }
12. 
13.            // UserActionDelay is DispatcherTimer timer of 300 ms that execute an Action
14.            this.userActionDelay = new UserActionDelay(this.UpdateFilterOnSearchText);
15.            this.documentsGridView.SearchPanelVisibilityChanged += (sender, args) =>
16.            {
17.// We are keeping a var on the telerik GridViewSearchPanel, initialized once when SearchPanelVisibilityChanged
18.                if (this.gridSearchPanel != null)
19.                    return;
20. 
21.                if (args.NewVisibility == Visibility.Visible)
22.                {
23.                    // ChildrenOfType is a method that search in the visual tree children...
24.                    this.gridSearchPanel = this.documentsGridView.ChildrenOfType<GridViewSearchPanel>().First();
25.                    this.gridSearchPanel.PreviewTextInput += SearchViewPanelOnPreviewTextInput;
26.                }
27.            };
28.        }
29. 
30.        private void SearchViewPanelOnPreviewTextInput(object sender1, TextCompositionEventArgs textCompositionEventArgs)
31.        {
32.            this.gridSearchPanel.PreviewTextInput -= SearchViewPanelOnPreviewTextInput;
33.           var searchBox = this.gridSearchPanel.ChildrenOfType<TextBox>().First();
34.            searchBox.TextChanged += SearchTextBox_TextChanged;
35.        }
36. 
37.        private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
38.        {
39.            this.searchText = ((TextBox)e.OriginalSource).Text;
40.            userActionDelay.DoAction();
41.        }
42. 
43.        private void UpdateFilterOnSearchText()
44.        {
45.            var searchViewModel  = this.gridSearchPanel.DataContext as Telerik.Windows.Controls.GridView.SearchPanel.SearchViewModel;
46.            if (searchViewModel != null)
47.            {
48.                searchViewModel.SearchText = this.searchText;
49.            }
50.        }
51. 
52....

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 01 Jun 2017, 08:13 AM
Hello Benjamin,

I tested the control locally with a similar setup and was not able to reproduce such performance issue. Attached to my reply you can find the sample application I used for testing. Can you please check it out and let me know how it defers from the usage of the component on your end? Also, in order to ensure that we are on the same page, would it be possible for you to demonstrate the problem in the sample project and send it as an attachment through a new support ticket? We will be happy to assist you further.

Thanks in advance for your cooperation.

Best Regards,
Stefan X1
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or