I am using pre_render to set select items in a rad grid in a user control. The method below is based on some Telerik posts. The checkboxes are populated when the user control opens for me locally and on the production server using IE8. But for other users (also using IE8), the check boxes only populate on postback. I have tested using compatibility mode on and off and do not see a change in behavior.
Any ideas or suggestions? It is challenging that the code is the same but the behavior is varying for some users.
Protected
Sub RadGrd_PreRender(sender As Object, e As System.EventArgs) Handles RadGrd.PreRender
If Not (Session("SelectedItems_" + ClientID) Is Nothing) Then
strSelectedItems = Session("SelectedItems_" + ClientID)
For Each item As GridItem In RadGrd.MasterTableView.Items
If TypeOf item Is GridDataItem Then
Dim dataItem As GridDataItem = CType(item, GridDataItem)
Dim chkBox As CheckBox = CType(dataItem("CheckBoxTemplateColumn").FindControl("CheckBox1"), CheckBox)
If strSelectedItems.Contains("," + dataItem.OwnerTableView.DataKeyValues(dataItem.ItemIndex)("ID").ToString() + ",") Then
chkBox.Checked =
True
Else
chkBox.Checked = False
End If
End If
Next
End If
End Sub