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?
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.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.