Last Updated: 04 Sep 2019 09:08 by ADMIN
Created on: 06 Jun 2013 13:51
Category: Grid
Type: Bug Report
RadGrid in HTML4 Not Retaining Selection on PostBack
The following steps create this issue:
1. Use html 4
2. Use telerik AJAX (For consistency)
3. Set a radgrid with some columns that reach beyond the extent of its element (such that it requires horizontal scrolling). Use at least four columns. One being the GridClientSelectColumn.
4. Have the following settings:
Control Settings: 

Control Events Used: NeedDataSource,OnItemDataBound
Client Settings:
EnablePostBackOnRowClick=false,Resizing AllowColumnResize=true, Selecting AllowRowSelect=true,UseClientSelectColumnOnly=false,Scrolling,AutoGenerateColumns=false,AllowScroll=true,UseStaticHeaders=true

Important note: Retain data on the server, rebind, and, on item databound, select the previously selected rows.

Set up a button to perform some action on the selected rows and have this action use AJAX such that this action depends on the currently selected rows in the RadGrid.

5. Scroll away from the selection checkboxes
6. Select some rows in your RadGrid
7. Perform your action with AJAX
If all was set up correctly, your grid should have been rebound with the previously selected rows re-selected. The RadGrid should still be scrolled to its previous position.
8. Perform your action with AJAX again. Here's the bug, the grid states that it has no selected items; however, the client shows that there are items selected in the UI.

This may be related to "RadGrid's last selected item index is not persisted correctly when two or more postbacks are triggered from external controls."
1 comment
Posted on: 04 Sep 2019 09:08
The feedback item was declined since HTML4 is outdated standard replaced by HTML5.

The lightweight rendering (which is the recommended and supported rendering of the AJAX controls) also requires HTML5 doctype:

<!DOCTYPE html>

Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.