Current filter:
                                You should refresh the page.
                                Support Center
                                1
                                  • I am using an ASPxTreeList control in one of my pages and it's working fine. I need to add a Filter Box functionality similar to the ASPxGridView's Filter Row.

                                    I am thinking of using an ASPxTextBox and handle the clientside TextChanged event. Is this the best option? How do I delay the firing of the event to say, 2 seconds after the last character was typed in?

                                    Thanks.

                                You must  log in  or  register  to leave comments

                                1 Solution

                                1

                                Hello Julius,

                                Thank you for your question. In fact, the filtering feature for the ASPxTreeList might be quite odd, because it simply breaks the hierarchical structure on tree list nodes, and you might get a completely different tree when you filter the control.
                                I am not sure that your scenario can be performed easily, because a similar implementation was performed in our ASPxComboBox control. Its approximate algorithm is the following:
                                1. A user presses a key, the client-side KeyUp (or KeyDown) event is handled;
                                2. In the event handler a small timer is started and it works for about two seconds;
                                2a. If the user presses another letter until the timer ends, we simply cancel the timer and then start it again;
                                2b. If two seconds have elapsed, a callback is sent to a control;
                                2c. If the user presses a key when a control is in a callback, the new callback is put in a queue. When the result returns from the server side, you should wait for this moment and send another callback from your queue.

                                I think that is all. I hope somehow, I helped you a bit :) If you have any questions, I will be waiting.

                                Thanks,
                                Vest

                                • Julius 02.01.2011

                                  Thanks for the algorithm, my js code is working well, so far. I will let you know if I encounter any issue.

                                  As for the hierarchical structure of the tree nodes, I have control over the construction of the datasource, so I do not have any issue, again, so far.

                                  Thanks,
                                  j

                                • Vest (DevExpress Support) 02.01.2011

                                  Hello Julius,

                                  I am glad to hear that you found my algorithm helpful. Feel free to use it and let us know your results.

                                  Thanks,
                                  Vest

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners