GridDateTimeColumn Page Reload on enter

4 posts, 0 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 27 Nov 2013 Link to this post

    I have a gird  on ap a web page and on the grid is a GridDateTimeColumn I allow filtering I have it set as

    <telerik:GridDateTimeColumn DataField="TradeDate" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime" FilterControlAltText="Filter TradeDate column" HeaderText="Trade Date" ReadOnly="True" SortExpression="TradeDate" UniqueName="TradeDate" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"  FilterControlWidth="110px"  EnableRangeFiltering="true" AutoPostBackOnFilter="true" ShowFilterIcon="false">
    </telerik:GridDateTimeColumn>

    This works fine but for some reason if the textbox next to the date time picker has focus and I hit the enter key it reloads the entire page.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Nov 2013 Link to this post

    Hi Eric,

    If you set AutoPostBackOnFilter property of a column to True, the user does not need to press the filter button to initiate filtering. Instead, a postback filter operation occurs when the user types a filter in the filter box and presses [Enter] from the keyboard. Hence what you face is an expected behavior, since pressing [Enter] makes a postback.

    Thanks,
    Shinu
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 28 Nov 2013 Link to this post

    Yes I understand that.   What's happening is if I hit tab or lose focus in anyway it runs the filter.  The issue is when I hit enter it runs the filter, and the. Runs a complete page post back. The grid is ajaxified so all all other fields when I hit enter it refreshes just the grid, when I tab off of any of the filter boxes it refreshes the grid, but when I hit enter on the to date box and only the to date box it will refresh the grid, and the it runs a complete page reload which sets the grid back to the original state.
  5. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 29 Nov 2013 Link to this post

    Ok never mind I found the issue.  It was a setting with the AjaxSetting they were set up in a way that it would cause that caused two distinct updates to run.
Back to Top