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

  • Home
  • SEARCH
  • 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 6744003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:01:54+00:00 2026-05-26T12:01:54+00:00

Currently using Telerik ASP .NET MVC Controls version 2011.2.712 Hello all, I am trying

  • 0

Currently using Telerik ASP .NET MVC Controls version 2011.2.712

Hello all, I am trying to implement a custom delete button. The reason for this is I have some other custom commands on my grid row and I would like to keep them all together. I would also like to point out that the grid is embedded within a tab on a larger display that includes other updatable grids. My grid definition is as follows:

Html.Telerik().Grid<CommentDto>()
    .Name("ReportCommentGrid")
    .DataKeys(keys => keys.Add(o => o.Id))
    .Editable(editing => editing.Mode(GridEditMode.InLine))
    .DataBinding(dataBinding => dataBinding.Ajax()
        .Select("SelectReportComment", "DebtRisk", new { id = Model.ReportCommentId })
        .Delete("DeleteReportComment", "DebtRisk")
        )
    .Columns(columns =>
    {
        columns.Bound(o => o.AssetGroupTypeCode).Title("Group").Width("10em").ReadOnly();
        columns.Bound(o => o.Text).Title("Comment").Width("25em").ReadOnly();
        columns.Bound(o => o.Id).ClientTemplate(
                "<# if(CreatedBy != null) { #>"
                + "<a class='t-button' href='#' onclick=\"LaunchCommentEditWindow('/DebtRisk/EditReportComment/<#= Id #>')\">Edit</a>"
                + "<a class=\"t-button t-grid-delete\" href=\"#\">Delete</a>"
                + "<# }  #>"
        ).Width("15em").Title("Related Data").ReadOnly(true).HtmlAttributes(new { @class = "t-last"})
    })
    .ClientEvents(events => events.OnRowDataBound("ReportCommentGrid_onRowDataBound"))
    .Footer(false)
    .Render();

I have the following javascript on the “ReportCommentGrid_onRowDataBound” event handler:

function  ReportCommentGrid_onRowDataBound(e)
{
    $(e.row).find('.t-grid-delete').click(function (ev)
    {
        ev.stopPropagation();
        ev.stopImmediatePropagation();
        ev.preventDefault();
        var grid = $("#ReportCommentGrid").data('tGrid');
        grid.deleteRow($(this).closest('tr'));

        return false;
    });
}

When I run the code and select the “Delete” button I get an “Object doesn’t support this property or method” error on the “grid.deleteRow”. Does anyone have any suggestions as to why this is happening

  • 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-26T12:01:55+00:00Added an answer on May 26, 2026 at 12:01 pm

    I never figured out how to implement a “Command” button outside the command column. I was able to use the new custom command available in the 2011 Q3 release (currently beta) to implement my custom edit button as a custom command.

    This custom edit button launches a pop-up window containing an edit form for the data on the grid row. I was not able to make the built-in popup edit work for me. Here the code below.

    Custom Edit button definition:

    commands.Custom("EditReportComment")
    .Text("Edit")
    .Ajax(true)
    .Action("EditReportComment","DebtRisk")
    .HtmlAttributes(new { @class="edit-report-comment" })
    .DataRouteValues(route => route.Add(o => o.Id).RouteKey("id"))
    ;
    

    Client event needed to attach row specific on-click event to edit button:

    .ClientEvents(events => events.OnRowDataBound("ReportCommentGrid_onRowDataBound"))
    

    On-Click wireup: (pulls href from button definition for window URL)

    function ReportCommentGrid_onRowDataBound(e)
    {
        var editLink = $(e.row).find('.edit-report-comment')
        editLink.click(function (ev)
        {
            ev.stopPropagation();
            ev.stopImmediatePropagation();
            ev.preventDefault();
            LaunchCommentEditWindow(editLink.attr("href"));
            return false;
        });
    }
    

    Pop-Up Window Launcher:

    function LaunchCommentEditWindow(editUrl)
    {
        var newWindow = $("<div id='EditReportComment'></div>").tWindow(
            {
            title: 'Edit Comment',
            contentUrl: editUrl,
            modal: true,
            resizeable: false,
            scrollable: false,
            width: 550,
            height: 200,
            onClose: function (e){ e.preventDefault(); newWindow.data('tWindow').destroy(); }
        });
        newWindow.data("tWindow").center().open();
        return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the telerik ASP.NET MVC Grid template and currently have several check
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I am using Telerik ASP.Net Ajax controls (theoretically shouldn't matter who makes the 3rd
I am looking people's opinion and experience on using chart controls within an ASP.NET
I am using ASP.NET and the Entity Framework to make a website. I currently
I'm using Telerik RadControls for ASP.NET and wondered if there was any way to
I am using a Telerik RadGrid in ASP.Net framework. I create Buy procedure and
I am currently working on a document management system in ASP.NET 3.5 using the
I am currently using Telerik's carousel control, but it is lacking many features and
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I

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.