or
| Protected Sub RadGridTransCalc_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridTransCalc.ItemCreated |
| If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then |
| Dim item As GridEditableItem = CType(e.Item, GridEditableItem) |
| Dim editor As GridDateTimeColumnEditor = CType(item.EditManager.GetColumnEditor("END_TIME"), GridDateTimeColumnEditor) |
| Dim cell As TableCell = CType(editor.PickerControl.Parent, TableCell) |
| Dim validator As CompareValidator = New CompareValidator |
| editor.TextBoxControl.ID = "ID_for_validation" |
| validator.ControlToValidate = editor.PickerControl.ID |
| validator.ControlToCompare = "START_TIME" |
| validator.Operator = "GreaterThan" |
| validator.Type = ValidationDataType.Date |
| validator.ErrorMessage = "End time must be greater than start time" |
| cell.Controls.Add(validator) |
| End If |
| End Sub |
On debugging I found that the following line is throwing the exception
| Dim cell As TableCell = CType(editor.PickerControl.Parent, TableCell) |
<CommandItemTemplate> <asp:LinkButton ID="ExportToPdfButton" runat="server" CommandName="ExportToPdf" CssClass="pdfButton" ></asp:LinkButton></CommandItemTemplate>Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated If TypeOf e.Item Is GridCommandItem Then Dim btn As LinkButton = e.Item.FindControl("ExportToPdfButton") If Not btn Is Nothing Then RadScriptManager.GetCurrent(Page).RegisterPostBackControl(btn) End If End IfEnd SubI tried on demos.telerik.com, and it removed the first javascript if I set MakeUrlsAbsolute =true. It appears that it is stripping out Javascript entirely.
http://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx
set ONLY the follow 3 properties =true:
EncodeScripts=true
MakeUrlsAbsolute=true
ConvertToXhtml=true
Click Set Built-In_Filters button, then paste the following js in the body.
<script type="text/javascript">function OnClientLoad(editor, args){ editor.get_filtersManager().add(new MyFilter());}</script> SOME RANDOM TEXT (NON-JS) <script type="text/javascript">function OnClientLoad(editor, args){ editor.get_filtersManager().add(new MyFilter());}</script>