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 7641709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:59:35+00:00 2026-05-31T08:59:35+00:00

Sorry if this is a repeat. I did a search and didn’t find anything

  • 0

Sorry if this is a repeat. I did a search and didn’t find anything that exactly matched my situation.

I have a grid that requires a ClientRowTemplate. I have the template working very well.

I need a button in that RowTemplate that calls back to a controller method through ajax. The controller method needs to perform some complex logic and then return a new set of data to the grid which the grid will then need to bind to. I thought this should work in the same fashion as an ajax binding. For instance, when you do a save or delete (using the built in buttons) an ajax method that is attributed with [GridAction] is called and then has an IQueryable returned. The grid automatically binds to this IQueryable.

How do I do the same thing with a custom button? Is it even possible to add a custom button when using a ClientRowTemplate?

  • 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-31T08:59:36+00:00Added an answer on May 31, 2026 at 8:59 am

    Put a link in the clienttemplate of your grid row

    @(Html.Telerik().Grid<myModel>()
    .Name("myGrid")
    .Columns(columns =>
    {
            @* You can put a link in your client template to trigger a refresh function *@
            columns.Bound(o => o.Id).ClientTemplate("<a href='javascript:refreshGrid(<#= Id #>);'>Refresh</a>");
            columns.Bound(e => e.col1);
            columns.Bound(e => e.col2);
            columns.Bound(e => e.col3);
    })
    .ClientEvents(events => events.OnDataBinding("myGrid_onRowDataBinding"))
    .DataBinding(dataBinding => dataBinding.Ajax().Select("Action", "Controller", new { param1 = ..., param2 = ... } )))
    

    Write your code to refresh grid

    <script type="text/javascript">
    
        //parameters needed for grid
        var x = ...;
        var y = ...;
    
        //grid refresh function
        function refreshGrid(id) {
            //make a call to server
            $.post("/controller/action/" + id, function() {
    
                //after making a successfull call to server
                //you may update parameters 
                x = ...;
                y = ...;
    
                //and rebind your grid
                $('#myGrid').data('tGrid').rebind();
            })        
        }
    
        //grid on row data binding event
        function myGrid_onRowDataBinding(e) {
            e.data = $.extend(e.data, { param1: x, param2: y });
        }
    </script>
    

    That’s it

    EDIT:

    ClientRowTemplate example

    You need to change only the grid code. The rest is same.

    @(Html.Telerik().Grid<myModel>()
    .Name("myGrid")   
    .ClientRowTemplate(grid => "<div class='firstcolumn'><a href='javascript:refreshGrid(<#= Id #>);'>Refresh</a></div><div class='secondcolumn'>Content....</div>")
    .ClientEvents(events => events.OnDataBinding("myGrid_onRowDataBinding"))
    .DataBinding(dataBinding => dataBinding.Ajax().Select("Action", "Controller", new { param1 = ..., param2 = ... } )))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a repeat but couldnt find anything the same ish... I
Sorry in advance if this is a repeat question. I didn't see it listed
Sorry if this is a repeat of a question asked previously, but I have
sorry if this is a repeat question! I have the following Javascript which works
I did a search around and couldn't find this already asked but I'm sure
Sorry if this is a repeat, but I couldnt find the answer on any
Question: Hello All, Sorry that this is kind of a noob question. I just
Sorry if I repeat my question but I have still had no clues of
(moved from previous post) - sorry if this is seen as a repeat! Hi
I'm new to Haskell, so am sorry if this is incredibly obvious... I have

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.