I am having trouble getting the DataNavigateUrlFormatString to work properly with client-side databinding.
I am binding the RadGrid client-side to a serialized collection of JSON objects. One of the object's properties is a JobID, which is a string representation of a GUID such as 'E45FA7DC-EAE5-4443-B72D-806D18FAE428'
I need to pass this string to a Javascript function, I am using a GridHyperlinkColumn in the RadGrid to do this:
I am getting the Javascript error "Unexpected token {" after calling the mastertableview.dataBind() function in Javascript (Google Chrome):
This appears to have to do with the DataNavigateUrlFormatString. From what I can tell, it specifically has to do with having single quotes around the {0} placeholder in the DataNavigateUrlFormatString property of the RadGridHyperlinkColumn. If I remove these, everything binds correctly:
Problem is, I have to have the single quotes there, since the value I am passing as a parameter to OpenJobInfoWindow is a string. What can I do to make this work?
I am binding the RadGrid client-side to a serialized collection of JSON objects. One of the object's properties is a JobID, which is a string representation of a GUID such as 'E45FA7DC-EAE5-4443-B72D-806D18FAE428'
I need to pass this string to a Javascript function, I am using a GridHyperlinkColumn in the RadGrid to do this:
<
telerik:GridHyperlinkColumn
DataTextField
=
"JobStatus"
HeaderText
=
"Job Status"
DataNavigateUrlFields
=
"JobID"
DataNavigateUrlFormatString
=
"javascript:OpenJobInfoWindow('{0}');"
>
<
ItemStyle
Width
=
"180"
/>
</
telerik:GridHyperlinkColumn
>
I am getting the Javascript error "Unexpected token {" after calling the mastertableview.dataBind() function in Javascript (Google Chrome):
Uncaught SyntaxError: Unexpected token {
Telerik.Web.UI.WebResource.axd:12965
Telerik.Web.UI.GridTableView._prepareHyperLinkColumnElement Telerik.Web.UI.WebResource.axd:12965
Telerik.Web.UI.GridTableView.dataBind Telerik.Web.UI.WebResource.axd:12883
RefreshSummaryCallback Status.aspx:216
l Telerik.Web.UI.WebResource.axd:6
(anonymous function) Telerik.Web.UI.WebResource.axd:6
Sys.Net.WebRequest.completed Telerik.Web.UI.WebResource.axd:6
_onReadyStateChange
This appears to have to do with the DataNavigateUrlFormatString. From what I can tell, it specifically has to do with having single quotes around the {0} placeholder in the DataNavigateUrlFormatString property of the RadGridHyperlinkColumn. If I remove these, everything binds correctly:
<
telerik:GridHyperlinkColumn
DataTextField
=
"JobStatus"
HeaderText
=
"Job Status"
DataNavigateUrlFields
=
"JobID"
DataNavigateUrlFormatString
=
"javascript:OpenJobInfoWindow({0});"
>
<
ItemStyle
Width
=
"180"
/>
</
telerik:GridHyperlinkColumn
>
Problem is, I have to have the single quotes there, since the value I am passing as a parameter to OpenJobInfoWindow is a string. What can I do to make this work?