I'm usig the clearfilter functionality as described in the below demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx
You can see in the demo, type something in the filter box and before filtering(before clicking enter or tab) if you click on clear filter button, it is filtering the grid instead of clearing the filter text box as it is firing the filtercommand..Is there a way to fix this.
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx
You can see in the demo, type something in the filter box and before filtering(before clicking enter or tab) if you click on clear filter button, it is filtering the grid instead of clearing the filter text box as it is firing the filtercommand..Is there a way to fix this.
5 Answers, 1 is accepted
0
Hi sirisha,
Can you share your grid declaration? I assume the reason for the problem is that the filter textbox you type in has AutoPostBack set to true, or the grid column has AutoPostBackOnFilter set to true. Thus when you click the clear button instead of its Click event to fire, as the filter textbox looses focus, it postbacks and filtering is performed.
I will check it out and try to find a way around the issue.
Greetings,
Iana
the Telerik team
Can you share your grid declaration? I assume the reason for the problem is that the filter textbox you type in has AutoPostBack set to true, or the grid column has AutoPostBackOnFilter set to true. Thus when you click the clear button instead of its Click event to fire, as the filter textbox looses focus, it postbacks and filtering is performed.
I will check it out and try to find a way around the issue.
Greetings,
Iana
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

sirisha
Top achievements
Rank 1
answered on 15 Jun 2011, 08:06 PM
<
telerik:RadGrid
ID
=
"GridView_Orders"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowSorting
=
"true"
AllowFilteringByColumn
=
"true"
OnNeedDataSource
=
"GridView_Orders_OnNeedDataSource"
OnItemDataBound
=
"GridView_Orders_OnItemDataBound"
OnItemCommand
=
"GridView_Orders_OnItemCommand"
AllowPaging
=
"true"
PageSize
=
"25"
EnableLinqExpressions
=
"false"
>
<
MasterTableView
DataKeyNames
=
"OrderID"
PagerStyle-Mode
=
"NextPrevAndNumeric"
PagerStyle-AlwaysVisible
=
"true"
>
<
Columns
>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
telerik:RadButton
ID
=
"buttonViewOrderDetails"
runat
=
"server"
runat
=
"server"
Text
=
"View Copy"
CommandName
=
"ViewOrderDetails"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"OrderID")%>'>
</
telerik:RadButton
>
</
ItemTemplate
>
<
FilterTemplate
>
<
asp:ImageButton
ID
=
"lnkClearFilters"
runat
=
"server"
ImageUrl
=
"~/Media/Images/removefilter.png"
OnClick
=
"ClearFilters_Click"
AlternateText
=
"Clear Filters"
/>
</
FilterTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<
asp:Image
ID
=
"imgCopySet"
BackColor
=
"Transparent"
runat
=
"server"
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "dcOrderCopySetExists") %>'/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<
asp:Image
ID
=
"imgSpotMatchStatus"
BackColor
=
"Transparent"
runat
=
"server"
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "dcOrderSpotMatchStatus") %>'/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"imgOrderDocument"
BackColor
=
"Transparent"
runat
=
"server"
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "dcOrderDocumentExists") %>'
OnClick='<%# ShowDocument(Eval("OrderID"),Eval("TimDB"),Eval("dcOrderDocumentExists")) %>'
AlternateText="View Contract"/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"OrderID"
UniqueName
=
"OrderID"
HeaderText
=
"Order ID"
FilterControlWidth
=
"50px"
CurrentFilterFunction
=
"EqualTo"
ShowFilterIcon
=
"false"
AutoPostBackOnFilter
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OrdDescription"
UniqueName
=
"OrdDescription"
HeaderText
=
"Description"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AgencyName"
UniqueName
=
"AgencyName"
HeaderText
=
"Agency"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ClientName"
UniqueName
=
"ClientName"
HeaderText
=
"Client"
FilterControlWidth
=
"100px"
CurrentFilterFunction
=
"Contains"
ShowFilterIcon
=
"false"
AutoPostBackOnFilter
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
DataField
=
"FlightStart"
UniqueName
=
"FlightStart"
HeaderText
=
"Flight Start"
DataFormatString
=
"{0:d}"
AllowFiltering
=
"false"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridDateTimeColumn
DataField
=
"FlightEnd"
UniqueName
=
"FlightEnd"
HeaderText
=
"Flight End"
DataFormatString
=
"{0:d}"
AllowFiltering
=
"false"
>
</
telerik:GridDateTimeColumn
>
<
custom:CustomFilterColumn
DataField
=
"OrdStatusDescription"
UniqueName
=
"OrdStatusDescription"
HeaderText
=
"Status"
>
</
custom:CustomFilterColumn
>
<
telerik:GridBoundColumn
DataField
=
"TimDB"
UniqueName
=
"TimDB"
HeaderText
=
"Tim"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Cancelled"
UniqueName
=
"Cancelled"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
0
Hi sirisha,
If it working the same way when the AutoPostBackOnFilter property is false?
Otherwise the described behavior is rather expected as described in my previous post.
Best wishes,
Iana
the Telerik team
If it working the same way when the AutoPostBackOnFilter property is false?
Otherwise the described behavior is rather expected as described in my previous post.
Best wishes,
Iana
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

sirisha
Top achievements
Rank 1
answered on 20 Jun 2011, 04:54 PM
if I change the autopostback property of column to false, filtering will not happen on click of enter. Is there a way to resolve this with autoppostback property of the column set to true...
0
Hi sirisha,
No, you cannot change the current behavior when the AutoPostBackOnFilter is set to true. What you can do instead is to handle the onkeydown client-side event of each of the filter textboxes. There check if [Enter] is pressed, execute custom javascript to fire the filter command for the column manually (as in this demo for instance). Otherwise, do nothing.
Regards,
Iana
the Telerik team
No, you cannot change the current behavior when the AutoPostBackOnFilter is set to true. What you can do instead is to handle the onkeydown client-side event of each of the filter textboxes. There check if [Enter] is pressed, execute custom javascript to fire the filter command for the column manually (as in this demo for instance). Otherwise, do nothing.
Regards,
Iana
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.