Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6728215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:08:35+00:00 2026-05-26T10:08:35+00:00

MVC3 and using the Telerik Grid. I’m using Phil Haacks Hidden Indexer Input For

  • 0

MVC3 and using the Telerik Grid.

I’m using Phil Haacks Hidden Indexer Input For Model to bring form values back. Only problem is that when using Ajax as the databinder any Templates used need to have a corresponding ClientTemplate. This is where I’m having a problem. How do I insert this, and the iterator into the ClientTemplate, which is expecting a string?

This is what I’ve tried to no avail … when I run the page I get an error saying ‘Iter’ is not defined.

<% int Iter = 0; %>
<% Html.Telerik().Grid(Model.TransferStudents)
       .Name("TransferStudents")
        .Columns(columns =>
                {
                    columns.Bound(o => o.Name)
                        .Width(250);
                    columns.Template(o =>{%> 

                        <%: Html.HiddenFor(model => Model.TransferStudents[Iter].StudentId)%>
                        <%: Html.CheckBoxFor(model => Model.TransferStudents[Iter].Transfer)%>
                        <%})
                        .ClientTemplate("<input type='hidden' id='StudentId' value='<#= StudentId #>' /><input type='checkbox' name='Transfer' <#= Transfer?  \"checked='checked'\" :\"\" #> />")
                        .HtmlAttributes(new { @style = "text-align: center;" })
                        .HeaderHtmlAttributes(new { @style = "text-align: center;" })
                        .HeaderTemplate("Check All <input type='checkbox' id='chkAll' />")
                        .Width(105);
                    columns.Template(o =>{ %><% Iter = Iter + 1; %><%})
                        .ClientTemplate("<# Iter = Iter + 1; #>")
                        .Hidden();
                    columns.Template(o =>{ %><%: Html.HiddenIndexerInputForModel()%><% })
                        .ClientTemplate("<#= Html.HiddenIndexerInputForModel() #>")
                        .Hidden();
                })
        .DataBinding(dataBinding => dataBinding.Ajax().OperationMode(GridOperationMode.Server).Select("_Transfer", "Administration"))
        .Pageable(paging => paging.Style(pagerStyles).PageSize(2, new[] { 5, 10, 15, 25, 50, 200 }).Position(GridPagerPosition.Top).Total((int)ViewData["total"]))
        .Sortable()
        .NoRecordsTemplate("<p class='instructions'>No Records Available</p>")
        .Render();
        %>

Any pointers would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:08:35+00:00Added an answer on May 26, 2026 at 10:08 am

    The ClientTemplate expects a string which will be translated to JavaScript and executed in the browser (client-side). Any server code such as Html.HiddenIndexerInputForModel() won’t work – there is no JavaScript equivalent. You need to use plain html as you have done in the other column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Telerik MVC3 grid, C#, .Net 2010; I have a grid in my razor
I am looking at using the Telerik MVC3 Razor grid control for a project.
I am playing about with the Telerik MVC3 extensions and in particular the Grid,
i have develop a small mvc3 application using Telerik Extension for asp.net mvc3 in
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I'm using the Telerik Extensions for ASP.NET MVC in an MVC3 project. I'm finding
I am using MVC3 and I want to have LogIn form and Register form
Hi I am Using Telerik MVC Grid Control in my MVC 3.0 Project I
I am using the latest version of Telerik MVC controls on my ASP.NET MVC3
I have a problem to render column template with Telerik Grid for MVC. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.