if (sender.get_id() == '<%=TitleAvailable.ClientID %>')
because the ClientID of the TitleAvailable RadGrid is only known by the UserControl and only after the user has clicked the Edit button to Load the UserControl. Also putting the handler script on the User Control page with the rest of the html markup doesn't work: I get a JScript error saying "'[onRowDropping function name]' is undefined". So I tried emitting the Javascript dynamically from within the Page Load event of the User Control, like so:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim scriptKey As String = "DragDropScript"
If Not Page.ClientScript.IsClientScriptBlockRegistered(scriptKey) Then
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), scriptKey, GetDragDropScripts(), True)
End If
TitleAvailable.ClientSettings.ClientEvents.OnRowDropping = "onListTitleRowDropping"
End Sub
Private Function GetDragDropScripts() As String
Dim sb As New StringBuilder()
sb.AppendLine("function onListTitleRowDropping(sender, args) {")
sb.AppendLine("}")
Return sb.ToString()
End Function
But if I do that, then right after the UserControl Page_Load event has completed, I again get a JScript error message " 'onListTitleRowDropping' is undefined" from this function of yours:
function Sys$_Application$add_init(handler) {
/// <summary locid="E:J#Sys._Application.init" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
if (this._initialized) {
handler(this, Sys.EventArgs.Empty);
}
else {
this.get_events().addHandler("init", handler);
}
}
Any ideas how to solve this?