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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:02:27+00:00 2026-05-24T02:02:27+00:00

Using telerik mvc grid with ajax, give me some headaches. I am trying to

  • 0

Using telerik mvc grid with ajax, give me some headaches.
I am trying to insert a column with some simple links, to perform the same behaviors that Delete command does (because I just don’t want the default command column).
But I am fail.
The default Delete command works great: delete the record and refresh the grid.
My custom link, only delete the record, but the grid is not refreshed.

Here is my code. Maybe I am missing a simple thing.

View:

@model  Benner.Saude.Mapeamento.Especialidade[]


@(Html.Telerik().Grid(Model)
    .Name("Grid")
    .DataKeys(keys => keys.Add(c => c.Handle))         
    .DataBinding(dataBinding => dataBinding
        .Ajax()
        .OperationMode(GridOperationMode.Client)
        .Select("AjaxPesquisar", "Especialidade")
        .Update("AjaxAtualizar", "Especialidade")
        .Delete("Delete", "Especialidade"))
    .HtmlAttributes(new { @class = "grid-padrao" })
    .ClientEvents(events => events
        .OnDataBound("atualizarCss")
    )
    .Columns(columns =>
    {
        .ClientTemplate("<text><a href='/Especialidade/Delete/33' class='formatacao delete-link' image='delete'/></text>")
        .Width(20).Title("Commands");  ***this does not works ***


        columns.Bound("Descricao").Title("Descrição");
        columns.Bound("Handle").Title("Código");
        columns.Command(commands =>
        {
            commands.Delete().ButtonType(GridButtonType.BareImage); ***this works***

        }).Width(70);

    })        
    .Pageable()
    .Sortable()

    )

Controller:

    [AcceptVerbs(HttpVerbs.Post | HttpVerbs.Get)]
    [GridAction]
    public ActionResult Delete(int id)
    {
        cadastro.ExcluirEspecialidade(Session["token"].ToString(), id);
        Especialidade[] especialidades = consulta.PesquisarEspecialidades(Session["token"].ToString());
        return View(new GridModel(especialidades));
    }

Javascript:

$("a.delete-link").click(function (event) {
    var link = $(this)[0];

    if (confirm("Confirm delete?")) {
        $.post(link.href);
    }

    return false;
});
  • 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-24T02:02:29+00:00Added an answer on May 24, 2026 at 2:02 am

    you have to get grid object and call rebind in ajax callback like

    $("a.delete-link").click(function (event) {
        var link = $(this)[0];
    
        if (confirm("Confirm delete?")) {
            $.post(link.href, function(data)
              {
                 var $grid = $("#Grid").data("tGrid");
                 $grid.rebind();
              });
        }
    
        return false;
    });
    

    In $("#Grid") “Grid” is name of your grid control on the page. rest is syntax

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

Sidebar

Related Questions

I am using Telerik MVC grid ajax binding to show some records. While the
I am working with some custom ajax functionality using Telerik's MVC Grid and I
I am using Telerik MVC Grid, with ajax binding and I use grid editing
i'm using telerik grid for mvc. I am using ajax binding, following is the
I am using the Telerik MVC grid, together with AJAX binding to actions secured
First some background..I am using the Telerik MVC Grid to display data. The grid
I am using the Telerik MVC Grid with Ajax binding, and am having a
I am using the Telerik MVC grid, with Ajax data binding. I would like
Using a Telerik Grid with ASP.NET MVC 3 Razor engine. When a user selects
I am trying to export Telerik MVC chart to PDF using svg.dll (works well

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.