Checkboxes are checked after page refresh

5 posts, 0 answers
  1. Mikael
    Mikael avatar
    11 posts
    Member since:
    Mar 2013

    Posted 11 Jul Link to this post

    Hi,

    When I selected rows and that I refresh my page with F5, the rows are not selected but the checkboxes are still checked.

    On Page_Load, I tried to do :
    - Radgrid.SelectedIndexes.Clear()
    - Radgrid.Rebind()
    - Radgrid.Datasource = null

    But It doesn't work.

  2. Mikael
    Mikael avatar
    11 posts
    Member since:
    Mar 2013

    Posted 13 Jul Link to this post

    I attached 2 images. On the first I select rows and on the second I refreshed the page. The rows are not selected but the checkboexes ares still checked.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 13 Jul Link to this post

    Hi Mikael,

    I tested the behavior and it seems that it is caused by specific browser behavior. The checkboxes are still checked after clicking F5 in Firefox and IE. However, the checkboxes are cleared in Chrome.

    You can replicate the same behavior with a simple input placed on the page:

    <input type="checkbox" id="someID">

    This most likely means that some browsers cache the content. In order to clear the checkboxes completely you can use Ctrl + F5 to refresh the page.

    Regards,
    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  5. Mikael
    Mikael avatar
    11 posts
    Member since:
    Mar 2013

    Posted 13 Jul Link to this post

    If the radgrid keeps the selected rows that wouldn't be a problem. But in this case the checkboxes are checked but the rows in radgrid aren't.
    For the moment I do that :

    $(document).ready(function (){    
    $('.rgMasterTable').find('input[type=checkbox]:checked').removeAttr('checked');
    });

  6. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 15 Jul Link to this post

    Hello Mikael,

    The RadGrid clears the selected rows as expected. However, the checkboxes are kept checked due to specific browser behavior. This is not related to the grid in any way You can see the same thing if you place a simple checkbox element on the page and refresh it with F5 in Firefox.

    An alternative approach to the one you are using would be to refresh the page with Ctrl + F5 - this should clear the checkboxes.

    Regards,
    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017