Hi,
I would like to know if we can implement the filtering of the gridview in a separate control outside of gridview. For example, I need to have a textbox in which we can have the same filtering effect on the gridview as the controls in the filter row of the gridview. If I type something in the textbox, it should filter the grid according to the field its bound to. Please let me know how to implement the same.
Thanks
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Ibrahim,
Thank you for the detailed description of the issue. I belive that it's possible to filter the ASPxGridView control based on the values of the external editors via the ASPxClientGirdView's AutoFilterByColumn method.
I've attached a test project, illustrating how you can implement the required functionality. I've also attached a screencast, illustrating how it works.
Thanks,
Mike
--------------------
Check if Search Engine is able to answer questions faster than I do!
--------------------
Hi Mike,
Thank you for the prompt reply. I was able to achieve the expected output. But I have a small issue. It doesn't work as in grid. I mean the text changed event occurs only if i change focus to another control. It doesnt run the client side event if i just type and leave it there only. I need to press tab in order to run the client side text changed event for the text box.
Also the ClearFilter() client side function is not working properly.
My Idea is to have a text box and a combo box in order to control the filter in the entire grid. I want it like a search program. But the filter doesnt clear the already existing filter applied to one column. This is the code I use:
<ClientSideEvents TextChanged="function(s, e) {
grid.ClearFilter();
grid.AutoFilterByColumn(combocat.GetValue().toString(), s.GetText());
}" />
So please advice me on the issue and provide me good solution. Also let me know if I can filter grid irrerespective of the columns. I mean to say, if I type "product", it should filter all rows containing "product" in all columns.
Thanx
Hello Ibrahim,
The TextChanged event is raised when the text is changed and the user switches the focus. If you wish, you can apply the filter when the KeyUp event is raised. Maybe this will better meet your requirements.
Regarding the ClearFilter method: the answer will be found after reading the The Concept of Callbacks KB article. Your code simply sends two subsequent callbacks, and only one of the callback results is returned.
Thanks,
Vest
Issue was solved successfully. Thank you for the support.
Hi,
Sorry for reopening the issue. The Textbox Keyup event is working fine. But I would like to make it like your autofilter row. For example, in my case it refresh the grid on every character I type. But with devexpress, it refresh the grid once we stop typing and after some time. For example: If I want to search for "printer", it refresh the grid on each character. But with devexpress, it refresh only after I complete "printer" or if I stop at "prin" or something like that. Please advice me on that.
Thanks
Hello Ibtahim,
The auto filter textboxes behave in a quite complex manner. I can't provide you with correct code, because it is hidden in our scripts, so if you wish so, you can debug the grid manually.
However, I can help you by providing an idea of how to implement the required functionality: when a key is pressed, the editor starts a timer with some timeout. When a user presses another button, the timer is reset and starts again. When either the enter key is pressed or the timer stops, there a filtering callback is performed to the server. During this process, you should check whether the text is changed, and if not, you shouldn't apply the filter.
thanks,
Vest