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

Checkboxes are checked after page refresh

4 Answers 2019 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mikael
Top achievements
Rank 1
Mikael asked on 11 Jul 2016, 07:49 AM

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.

4 Answers, 1 is accepted

Sort by
0
Mikael
Top achievements
Rank 1
answered on 13 Jul 2016, 06:27 AM
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.
0
Viktor Tachev
Telerik team
answered on 13 Jul 2016, 02:08 PM
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.
0
Mikael
Top achievements
Rank 1
answered on 13 Jul 2016, 03:01 PM

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');
});

0
Viktor Tachev
Telerik team
answered on 15 Jul 2016, 11:00 AM
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.
Tags
Grid
Asked by
Mikael
Top achievements
Rank 1
Answers by
Mikael
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or