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
<
telerik:RadFileExplorer
runat
=
"server"
ID
=
"RadFileExplorer2"
Width
=
"500px"
Height
=
"300px"
EnableOpenFile
=
"true"
EnableCreateNewFolder
=
"true"
>
</
telerik:RadFileExplorer
>
RadFileExplorer2.Configuration.ViewPaths =
new
string
[] {
"~/Files"
,
"~/Files"
};
RadFileExplorer2.Configuration.UploadPaths =
new
string
[] {
"~/Files"
,
"~/Files"
};
RadFileExplorer2.Configuration.DeletePaths =
new
string
[] {
"~/Files"
,
"~/Files"
};
Unhandled exception at line 885, column 13 in http://server1/ScriptResource.axd?d=1A_JfTzkVI_BPK0wyueglza3uf3p5EQOp4lCh3bkZFj2kwIlPrGfNBqAYyJG42yrzLhNfZTtBWoYuqokkf-vNOdy8LQfqHEEJse-2Zpg5nGn_znQ0ma5rdc2XuV8eHZvGcbaSsZ0Wu1n7TPfMrcwAYGxAJyYoPMx7lFZ_2kSkbfeRFZ1GXIexwskAgJ3NeM67J1V_H9-C5a9cYJV09SQKA2&t=6119e399
0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Expression cannot be null or empty
Whats the correct way to create a column from codebehind?
Marcel de Groot
-----------
GridBoundColumn col =
new
GridBoundColumn();
col.UniqueName = field.UniqueName;
col.HeaderText = field.Caption;
col.DataField = field.UniqueName;
// col.GroupByExpression =field.UniqueName + " Group by "+ field.UniqueName;
col.SortExpression = field.UniqueName;
col.HeaderButtonType = GridHeaderButtonType.TextButton;
RadGrid1.Columns.Add(col);
<
MasterTableView
Width
=
"100%"
>
<
GroupByExpressions
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"Key"
HeaderText
=
"Key"
HeaderButtonType
=
"TextButton"
DataField
=
"Key"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
EditMode
="EditForms" is working but I have 100 of pages are using EditMode="PopUp".
var reModuleDivs = document.getElementsByClassName("reModule");
var reModuleDiv = reModuleDivs[0];
var notesEditorUpdatePanel = document.getElementById("<%= notesEditorUpdatePanel.ClientID %>");
reModuleDiv.appendChild(notesEditorUpdatePanel);