How to apply Context Menu to specific Grid or ListView rows

3 posts, 1 answers
  1. Paul Grothe
    Paul Grothe avatar
    26 posts
    Member since:
    Apr 2010

    Posted 04 Dec 2015 Link to this post

    I am looking at the Context Menu demo at

    There are several buttons that are part of the context menu such as Reply, Reply All, Forward, etc.  However, they do not do anything so I do not see anything in the demo or anywhere else that demonstrates how you would wire this up to make a working application.

    The first thing I am trying to figure out is if you wanted the reply button to work, how would you get the data from the row that the user is clicking on?

    I tried something like this:

                    .Items(children =>
                        children.Add().Text("Reply To Sender").ImageUrl(Url.Content("~/content/web/toolbar/reply.png")).Action("Reply", "WebMail", Model);
                        children.Add().Text("Reply To All").ImageUrl(Url.Content("~/content/web/toolbar/reply.png")).Action("ReplyAll", "WebMail", Model);

    Of course it doesn't work because Model would refer to the page's model.  How would I pass in data from the model that is applied on the row level?

    The row level model for the demo is Kendo.Mvc.Examples.Models.WebMail.  Can you pass in this model or data from this model into the action link so that when the user clicks reply you can get the data for the mail item they clicked on?  Or if you accomplish this via javascript on the select event, is there an example somewhere of how that would be done?

  2. Answer
    Dimiter Madjarov
    Dimiter Madjarov avatar
    2127 posts

    Posted 07 Dec 2015 Link to this post

    Hello Paul,

    Indeed you could use the select event handler of the Context menu to retrieve the currently clicked item. Here is a short example that demonstrates the approach. The select event implementation is the same for the MVC widgets.

    Dimiter Madjarov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
  4. Paul Grothe
    Paul Grothe avatar
    26 posts
    Member since:
    Apr 2010

    Posted 08 Dec 2015 in reply to Dimiter Madjarov Link to this post

    Thanks Dimiter, that had the information I needed.  Setting the filter to the row element (filter: "tr[role='row']") was really key so that the row index would be returned in
Back to Top