I have a page that contains a RadGrid. One of the columns contains a hyperlink in an edit template as so:
<telerik:GridTemplateColumn HeaderText="Asset Name" FilterControlAltText="FilterAssetName">
<ItemTemplate>
<asp:HyperLink ID="hplEditAsset" runat="server" ForeColor="Blue" AutoPostBackOnFilter="true"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
I'm loading the data through a webservice, so I'd like to bind data to the grid on the client side. I'm trying to access the hyperlink in a javascript function as follows:
function gridRowBound(sender, args) {
var row = args.get_item()
var link = $telerik.findElement(row , 'hplEditAsset');
var d = args.get_dataItem();
link.innerHtml = d.Url;
link.outerHtml = d.UrlDescription;
}
The data being bound to the grid is in the form of List<MyDataRow>, and MyDataRow has properties named Url and UrlDescription.
When I run the code, row is set to "tr#ctl00_MainContent_QuickScanGrid_ctl00__0.rgRow" according to Firebug. However, the script fails on the next line and link is never set.
How do I access that element so that I can bind the hyperlink to the data on the client side?
<telerik:GridTemplateColumn HeaderText="Asset Name" FilterControlAltText="FilterAssetName">
<ItemTemplate>
<asp:HyperLink ID="hplEditAsset" runat="server" ForeColor="Blue" AutoPostBackOnFilter="true"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
I'm loading the data through a webservice, so I'd like to bind data to the grid on the client side. I'm trying to access the hyperlink in a javascript function as follows:
function gridRowBound(sender, args) {
var row = args.get_item()
var link = $telerik.findElement(row , 'hplEditAsset');
var d = args.get_dataItem();
link.innerHtml = d.Url;
link.outerHtml = d.UrlDescription;
}
The data being bound to the grid is in the form of List<MyDataRow>, and MyDataRow has properties named Url and UrlDescription.
When I run the code, row is set to "tr#ctl00_MainContent_QuickScanGrid_ctl00__0.rgRow" according to Firebug. However, the script fails on the next line and link is never set.
How do I access that element so that I can bind the hyperlink to the data on the client side?