radgrid filter - Autopostback if i click mouse anywhere

3 posts, 1 answers
  1. Padmasinh
    Padmasinh avatar
    21 posts
    Member since:
    Feb 2014

    Posted 28 Feb 2014 Link to this post

    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.

  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 05 Mar 2014 Link to this post

    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"
        <MasterTableView AutoGenerateColumns="false">
                <telerik:GridBoundColumn DataField="ID" AutoPostBackOnFilter="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="FirstName" AutoPostBackOnFilter="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="LastName" AutoPostBackOnFilter="true"></telerik:GridBoundColumn>
    <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.

    Konstantin Dikov

    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!

  3. Padmasinh
    Padmasinh avatar
    21 posts
    Member since:
    Feb 2014

    Posted 05 Mar 2014 in reply to Konstantin Dikov Link to this post

    Thanks a lot :)

    Konstantin Dikov
Back to Top