The following works just fine in FireFox to set focus to a text box when the form is in edit mode:
In IE I get an error:
Sys.InvalidOperationException: Handler must be a function.
The var name contains "rowCreated" suggesting that IE doesn't like "document.getElementById('{0}').focus()"
I have also tried inserting a function call here with a function in the ascx. This works in FF but, yet again not in IE.
I have read a lot of posts on this subject and tried many without success. IE seems to be the difficulty as it works in FF, Safari and Chrome.
All I want to do is setfocus to a text box when the grid enters edit mode. Not that I think this should be a problem but I am using dynamically loaded ascx controls running in DotNetNuke.
Declan
Private Sub grd_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grd.ItemDataBound |
If (TypeOf (e.Item) Is GridEditFormItem) AndAlso e.Item.IsInEditMode Then |
Dim box As TextBox = e.Item.FindControl("ContactName") |
grd.ClientSettings.ClientEvents.OnRowCreated = String.Format("document.getElementById('{0}').focus()", box.ClientID) |
In IE I get an error:
Sys.InvalidOperationException: Handler must be a function.
function Sys$Component$_setReferences(component, references) { |
... other code here ... |
if (events) { |
for (var name in events) { |
if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name)); |
if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction); |
component["add_" + name](events[name]); |
} |
} |
The var name contains "rowCreated" suggesting that IE doesn't like "document.getElementById('{0}').focus()"
I have also tried inserting a function call here with a function in the ascx. This works in FF but, yet again not in IE.
I have read a lot of posts on this subject and tried many without success. IE seems to be the difficulty as it works in FF, Safari and Chrome.
All I want to do is setfocus to a text box when the grid enters edit mode. Not that I think this should be a problem but I am using dynamically loaded ascx controls running in DotNetNuke.
Declan