Click here to Skip to main content
15,888,022 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
When I sort the grid and click on the image link of the column nothing happens.
In short if client template is an image, the link in client template is not working.

XML
<% Html.Telerik().Grid(Model.GetVariables)
                        .Name("VariableGrid")
                        .DataKeys(dataKeys => dataKeys.Add(m => m.variableId))
                        .Columns(columns =>
                            {
                                columns.Bound(m => m.variableDescription).Title("Description");
                                columns.Bound(m => m.variableVoiceLink).Title("Voice Link")
                                    //Template to show Listen (Speaker) icon
                                    .Template(m =>
                                            {%>
                                                <a href="#?w=300" rel="popup_Upload" class="poplightUpload" lang="<%=m.variableId%>" >
                                                    <img title="Upload audio" style="border:0; float:right;"  src="<%:Url.Content("~/Content/TMG/Images/Upload.png") %>" />
                                                </a>
                                                <% if (!string.IsNullOrEmpty(m.variableVoiceLink))
                                                   { %>

                                                        <sup><label style="padding-right:4px; font-size:small;" ><%=m.variableVoiceLink%> </label>
                                                        <a style=" padding:6px" href="#?w=300" rel="popup_name" class="poplight" lang="<%=m.variableVoiceLink%>" >
                                                            <img title="Play Voice" style="border:0; float:right; padding-right:3px;"  src="<%:Url.Content("~/Content/TMG/Images/speaker.png") %>" />
                                                       </a>
                                                       </sup>

                                                   <%}
                                                   else
                                                   {%> <label><%=m.variableVoiceLink%> </label> <%} %>

                                            <%})
                                    

.ClientTemplate("<a href='#?w=300' rel='popup_Upload' class='poplightUpload' lang = '<#= variableId #>' >" +
                                                        "<img title='Upload audio' style='border:0; float:right;'  src='../Content/TMG/Images/Upload.png'/>" +
                                                      "</a>" +
                                                       "<# if (variableVoiceLink != null)" +
                                                        "{ #> <sup><label style='padding-right:4px; font-size:small;'> <#= variableVoiceLink #> </label>" +
                                                              "<a href='#?w=300' rel='popup_name' class='poplight' lang = '<#= variableVoiceLink #>' >" +
                                                                "<img title='Play Voice' style='border:0; float:right;'  src='../Content/TMG/Images/speaker.png'/>" +
                                                              "</a></sup>" +
                                                        "<# } #>");
Posted
Updated 28-Mar-11 5:31am
v2
Comments
Dalek Dave 28-Mar-11 11:31am    
Edited for Grammar.

1 solution

Did you tried looking here: Telerik MVC Grid Forum[^]
I just think, posting such issues about a 3rd party control at telerik Forum would be more useful.
Might be someone already discussed it over there! Search before posting.

Posting here is fine. Might be someone can help but I had found that specific questions related to 3rd party is answered more quickly and accurately at respective forums.
 
Share this answer
 
v3
Comments
uandme77 28-Mar-11 12:45pm    
Thank you for replying sandeeep..
my application is in MVC, RadGrid is of no use to me i guess. I am using telerik MVC grid.
Sandeep Mewara 28-Mar-11 12:46pm    
Forum for the same would be there. Did you see?
Sandeep Mewara 28-Mar-11 12:47pm    
Updated my answer with the Telerik MVC Grid.
uandme77 28-Mar-11 12:52pm    
i have searched for it.. the solution given is to use templates..and when i use templates it works fine..but when i sort it or refresh it and then again if i click on image link nothing happens.
Sandeep Mewara 28-Mar-11 13:03pm    
Better would be to post there. They would understand it more and provide you a quick solution/resolution if it is an issue. They know their code os grid in & out.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900