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

strange behavior for AutoPostbackOnfilter

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 12 Jun 2011, 05:04 PM
If I set AutoPostbackOnFilter="true" and CurrentFilterFunction="StartsWith", then when a user enters some text and hits enter, the grid will be filtered properly. However, I have noticed, if the user enters text, and then decided to use the filter menu, sometimes the grid filters AS SOON AS they click on the filter icon, as opposed to when they select a menu item. Its almost as if clicking on the filter menu icon causes the grid to filter. This does not occur if AutoPostbackOnFilter="False".

I believe this only happens after the user selects a filter function other than "Starts With".. So, the user selects something other, like "Contains", everything work fine. Then they click on the filter menu icon (the filter funciton "Contains" is now different that what is specified in the Grid declaration "CurrentFilterFunction='StartsWith"), and the filter occurs immediately before they even have a chance to selct an option.

Any idea what's going on.

3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 16 Jun 2011, 06:39 AM
Hi Albert,

This behavior is expected since when you have AutoPostBackOnFilter=true, the grid will filter immediately after the filter box is blurred. 

Best wishes,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 16 Jun 2011, 01:18 PM
It would seem to me that developers would like to allow users to filter the grid using the filter menu AND by hitting the enter key. The current capability which filters on blur doesn't make this particularly easy as I described below. I might suggest Telerik look into handling the key-press event in the textbox, checking if the enter key was pressed, and filtering on that, rather than on blur. I believe if the filter box were a RadInput, this would be relatively straighforward so I know that Telerik has the capability of achieving this in a built-in fashion. Rather than changing the existing FilterOnPostback fuctionality, it would probably be best just to introduce a new "FilterOnKeyPress" property and allow the user to specify which key(s) will cause it to filter.
0
Tsvetoslav
Telerik team
answered on 21 Jun 2011, 08:36 AM
Hello Albert,

Thanks for the feedback.

You can easily achieve your requirement with a couple of lines of code. Please, check out the attached sample (note the ProductName column).

Regards,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Tsvetoslav
Telerik team
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Share this question
or