I have a gridboundcolumn with attribute FilerDelay set to 1. The filter works correctly, after 1 second the autopostback is done and the filter command is "EqualTo". The problem is that if I wish to remove the filter by selecting from the filter list the "NoFilter" voice, on ItemCommand method, the argument of the command remains "EqualTo" instead of "NoFilter". So I can't remove the filter set before. Every other choises(GreaterThen, Less.....etc) apart from "NoFilter" work correctly and are 'recognised' inside the ItemCommand method.
Could you please help me with this problem?
Thank you very much.
Marina
6 Answers, 1 is accepted
When you have set FilterDelay and AutoPostBackOnFilter="true", clearing the filter is done by deleting the text in the filter textbox. Otherwise, if RadGrid determines the filter textbox contains a value other than empty string, it applies the default filter ("EqualTo" in your case), no matter the filter option you have chosen from the menu. To work around this scenario and have the NoFilter menu option to clear the current applied filter for this column, you can attach to the filter menu OnClientItemClicking event:
<
telerik:RadGrid
>
<
FilterMenu
OnClientItemClicking
=
"clientItemClicking"
></
FilterMenu
>
</
telerik:RadGrid
>
and use the following javascript:
function
clientItemClicking(sender, args)
{
if
(args.get_item().get_value() ===
"NoFilter"
)
{
var
target = args.get_targetElement();
var
filterBox = target.parentNode.getElementsByTagName(
"input"
)[0];
filterBox.value =
""
;
}
}
The above script clears the value of the filter textbox for the column in which the context menu was opened.
Greetings,
Veli
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.
Because I have this situation, if I wtrite some text in the filter textbox the grid is filtered correctly after the filter delay, but if I erase the text I have to hit enter to "erase " the filter, is it possible to do it automatically without hitting enter after clearing textbox?
The automatic filtering occurs when the filter input's onchange event fires. The onchange event of an HTML input element fires when the input value is changed and the control loses focus, i.e. is blurred. In your scenario, you need to either press Tab after deleting the text from the input, or click somewhere else with the mouse. Both actions blur the filter input and cause the grid to automatically fire the filter command.
Greetings,
Veli
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.
I have the same problem - AutoPostBackOnFilter="true" and now setting the NoFilter is not working anymore (the CurrentFilterValue is autmatically is set)
I use the ItemCommand event receiver to get the filters that are set.
How can I set the CurrentFilterValue to NoFilter or make shure that this value is not changed to the default value when NoFilter is clicked?
->Version 2015.2.623.35, in SharePoint 2010 and therefore document mode od IE8.<-
I would suggest you to upgrade your application to the latest official release of the controls and see if the issue still appear. Also if the problem still exists i would suggest you to open separate thread,as the current one is rather old and in a new thread it will be easier for us to track the issue in your specific scenario.
Regards,
Maria Ilieva
Telerik