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

radgrid filter - Autopostback if i click mouse anywhere

2 Answers 292 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Padmasinh
Top achievements
Rank 1
Padmasinh asked on 28 Feb 2014, 10:49 AM
There is problem with filter option. When i enter any text in filer textbox and then click on page navigation link, on first click grid filter is occur and on second click page navigation is occur. So i want page should be navigated on first click when i enter any text in filter and click on navigation link.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 05 Mar 2014, 07:49 AM
Hello Padmasinh,

The behavior that you are describing could occur if you have set the AutoPostBackOnFilter property of your columns to true. If that is the case, the behavior that you are observing is expected, since the filter command is fired on the blur event of the input element of the filter, which will fire before the click event of the navigation link.

You could test the following which will reproduce the same behavior:
<telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource"
     AllowFilteringByColumn="true">
    <MasterTableView AutoGenerateColumns="false">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" AutoPostBackOnFilter="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FirstName" AutoPostBackOnFilter="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LastName" AutoPostBackOnFilter="true"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView
</telerik:RadGrid>
 
<asp:LinkButton PostBackUrl="~/TestPage.aspx" Text="Test page" runat="server"></asp:LinkButton>

Having that in mind, in order to achieve the desired behavior you will have to set the AutoPostBackOnFilter property to false.

Hope that helps.


Regards,
Konstantin Dikov
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Padmasinh
Top achievements
Rank 1
answered on 05 Mar 2014, 03:27 PM
Thanks a lot :)

Konstantin Dikov
Tags
Ajax
Asked by
Padmasinh
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Padmasinh
Top achievements
Rank 1
Share this question
or