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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:55:02+00:00 2026-06-07T10:55:02+00:00

I finally got my asp.net grid to display data… But I need it to

  • 0

I finally got my asp.net grid to display data…
But I need it to link to an action when clicking on one of the rows… or if need be, a single column How can I get a route into one of my columns or rows in MVC3?

I am using jqGrid btw…

Here is how I set up my Grid

$("#list").jqGrid({
                        shrinkToFit: false,
                        autowidth: true,
                        datatype: 'jsonstring',
                        mtype: 'POST',
                        colNames: [
                                   'MRN',
                                   'Hospital Fin',
                                   'First Name',
                                   'Last Name',
                                   'Date of birth',
                                   'Completed Pathway',
                                   'Completed Pathway Reason',
                                   'PCP Appointment',
                                   'Specialist Appointment',
                                   'Admit Date'
                                   ],
                        colModel: [
                                   { name: 'MRN', width: 125, align: 'left' },
                                   { name: 'Hospital_Fin', width: 145, align: 'left' },
                                   { name: 'First_Name', width: 115, align: 'left' },
                                   { name: 'Last_Name', width: 115, align: 'left' },
                                   { name: 'Date_of_birth', width: 145, align: 'left' },
                                   { name: 'Completed_Pathway', width: 125, align: 'left' },
                                   { name: 'Completed_Pathway_Reason', width: 165, align: 'left' },
                                   { name: 'PCP_Appointment', width: 115, align: 'left' },
                                   { name: 'Specialist_Appointment', width: 125, align: 'left' },
                                   { name: 'Admit_Date', width: 185, align: 'left' }],
                        rowNum: 10,
                        rowList: [5, 10, 20, 50],
                        sortname: 'Id',
                        sortorder: "desc",
                        viewrecords: true,
                        imgpath: '/Content/themes/UPMC-theme/images',
                        caption: 'My first grid'
    });

Any way to make an entire row clickable to an action method?
To open my view I need to call a controller and an action…

EditEncoutner is the controller, and EditEncounter is the Action…

public ActionResult EditEncounter(int encounterId, int popId)
        {
            string UID = HttpContext.User.Identity.Name;
            DataRepository dr = new DataRepository();
            PatientACOModel patMod = dr.Get(encounterId, UID);
            TempData["POPULATIONID"] = popId;
            return View(patMod);
        }

Now I write up the JSON string myself… I am think of putting an <a /> tag in the relevant columns. But that would mean I am not making the entire row clickable, and I would then have to chose which column to put the link…
I could just make an edit column, which is what I will do if all else fails, I was kind of hoping for a more elegant solution however.

  • 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-06-07T10:55:03+00:00Added an answer on June 7, 2026 at 10:55 am

    Assuming your View is binded to a List of Products class objects

    @model IEnumerable<Product>
    <table>
    @foreach(var product in Model)
    {
     <tr class="trClickable" data-viewurl="@Url.Action("View","Product",new {@id=product.ID})">
       <td>
         @product.Name
       </td>
       <td>
         @product.Price
       </td>
     </tr>
    }
    </table>
    

    We will add a little javascript to capture the click event of the row.

    <script type="text/javascript">
     $(function () {
         $(".trClickable").click(function () {
             var item = $(this);
             window.location.href = item.data("viewurl");
         });
     });
    

    Assuming you have an action method called View inside your ProductController which accepts a parameter called id and show some data in it’s view

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

Sidebar

Related Questions

I've started working with ASP.net AJAX (finally ☺). and I've got an update panel
So I've finally got my WCF service setup and talking to browser via ASP.NET
I'm developing something in asp.net and finally got round to creating the UI. I
I am writing a TwoWay Binding control for ASP.NET. I finally got things working.
After many hair-pulling frustrations I've finally got one version of the PerlMagick module working
I've got an ASP.NET application that I installed by creating a web setup. I
I am working on asp.net web application in which i need to show the
I finally got to try .NET MVC this weekend and, as was expected, ran
What I've got is an ASP.NET MasterPage/ContentPage, where the ContentPage utilizes an UpdatePanel with
It took me a long time but I finally got nHibernate's Hello World to

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.