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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:48:11+00:00 2026-06-04T13:48:11+00:00

I have a MVC3 WebGrid in my View.I want to display a tooltip when

  • 0

I have a MVC3 WebGrid in my View.I want to display a tooltip when the mouse hovers over any row, displaying information coming from the server. I have already seen this link:
Show a tooltip with more info when mousover a MVC3 Razor WebGrid row

My point is,how will I get the ID of the row on mouseover event,because the information coming from the server will be based on row ID or maybe count. Also, in this link:
http://www.lullabot.com/files/bt/bt-latest/DEMO/index.html
you need a certain Selector to show the tooltip.So how can I assign a class to each row of WebGrid so I can display the tooltip?

  • 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-04T13:48:13+00:00Added an answer on June 4, 2026 at 1:48 pm

    Here is how I did it. Because of the limited nature of the default WebGrid, you are left with a few options… I needed this to work with IE6 and could NOT find a suitable jQuery plugin that would work in all browser, so I opted for option 1. Warning: It’s a bit dirty

    1 – Roll your own HtmlHelper
    2 – Use a third-party alternative to WebGrid
    3 – Use a jQuery plugin

    HtmlHelpers.cs

    /// <summary>
    /// This class contains various methods for supplementing the usage of html within the Razor view pages
    /// </summary>
    public static class HtmlHelpers
    {
        /// <summary>
        /// This method truncates a string to a given length for display within a WebGrid or elsewhere as a tooltip
        /// </summary>
        /// <param name="helper">Generic parameter needed to recognize HtmlHelper syntax</param>
        /// <param name="input">This is the string to truncate</param>
        /// <param name="length">The length of the string to truncate to</param>
        /// <returns>Html representing a tooltip, if needed</returns>
        public static IHtmlString ToolTip(this HtmlHelper helper, String input, int length)
        {
            if (input.Length <= length)
                return new MvcHtmlString(input);
    
            else
                return new MvcHtmlString(String.Format("<span title=\"{2}\">{0}{1}</span>", input.Substring(0, length), "...", input));
    
        }
    }
    

    YourView.cshtml

    grid.Column(columnName: "Detail", header: "Description", format: @<text>@Html.Truncate((string)item.Detail,50)</text>),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have a little problem with WebGrid control for Asp.Net MVC3. What I want
I have an MVC3 program in which I want to query a database and
I have an MVC3 C#.Net web app. I have a requirement to display a
Actually I have some MVC3 Applications and I want to call this applications from
I have an MVC3 webgrid where the first column is being hidden by jQuery
I have a WebHelpers WebGrid in MVC 3.0 and would like to custom display
I have an MVC3 View that's posting back a set of input values via
Possible Duplicate: Schedule Controls for ASP.Net MVC I have MVC3 in which I want
I have an MVC3 Razor view which has a link that requires user login
I have the following WebGrid in my ASP.NET MVC3 test application. It displays a

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.