This is a migrated thread and some comments may be shown as answers.

[Solved] ClientTemplate bug?

2 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Patrik
Top achievements
Rank 1
Patrik asked on 15 Jun 2011, 10:44 AM
I got this,

@(Html.Telerik().Grid(Model.Model)
              .Name("OrdersGrid")
                      .Columns(columns =>
                      {                                                   
                          columns.Bound(dlm => dlm.Firstname);
                          columns.Bound(dlm => dlm.Surname);
                          columns.Bound(dlm => dlm.CountryName).Title("Country");
                          columns.Bound(dlm => dlm.Id).ClientTemplate("<a href=\"/Community/Helpdesk/Edit/<#= Id #>\" />Edit</a>");
                      })
              .DataBinding(dataBinding => dataBinding.Ajax().Select(new RouteValueDictionary { { "Action", "GetUserList" }, { "Controller", "Helpdesk" }, { "Area", "Community" }, { "Search", Model.SearchString } }))
              .EnableCustomBinding(true)
              .Pageable(paging => paging.Total(100).PageSize(10))             
              .DataKeys(dk => dk.Add(key => key.Id)))

I got, as shown above, just 1 client template, the id field. The Id is a guid. Now when i run this, i get the following output.
<td class="t-last"><a href="/Community/Helpdesk/Edit/cb0bc413-d1ce-46de-aa2c-d5cc47aeb9b8"></a>Edit</td>

Did i miss something? or why is the link text appearing outside of the link? In the client template above its inside.
Also, is there a way to render MVC links in the client template when the call was made with Ajax?

I am using the following version of Telerik: 2011_1_315 and all the telerik script files are loaded from telerik cdn.

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Jun 2011, 12:19 PM
Hi Patrik,

 Your template is wrong because you are closing the link yourself:

<a href=\"/Community/Helpdesk/Edit/<#= Id #>\" />Edit</a>

The right template is this:

<a href=\"/Community/Helpdesk/Edit/<#= Id #>\">Edit</a>

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Patrik
Top achievements
Rank 1
answered on 15 Jun 2011, 12:21 PM
Ahh yes, sorry. Sometimes you get pretty blind staring at the code. But shouldn't the extra </a> get printed anyway?
Tags
Grid
Asked by
Patrik
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Patrik
Top achievements
Rank 1
Share this question
or