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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:48:13+00:00 2026-06-13T05:48:13+00:00

I have an stored procedure from my DB and I transform it into a

  • 0

I have an stored procedure from my DB and I transform it into a WebGrid in my Web application. The problem is that, since the columns I got from the stored procedure are dynamic (it means I don’t how many columns are and each one’s name) I don’t specify the columns variable in grid.GetHtml() function, I have something like this:

@grid.GetHtml(fillEmptyRows: false,
        tableStyle: "table table-hover",
        mode: WebGridPagerModes.All,
        firstText: "<< First",
        previousText: "< Back",
        nextText: "Next >",
        lastText: "Last >>"
        )

And that’s it!

So, the question is, How can I give style to just one column?, for example I know that at least one column is “Name” and I want it to have “width:100px” Because if I just specify one column it will show just that column! Please I hope you guys can help me. Thanks in advance.

  • 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-13T05:48:16+00:00Added an answer on June 13, 2026 at 5:48 am

    You can do this using Javascript — I’m not sure if there’s a way to do it using strictly the WebGrid / CSS.

    First, make the WebGrid table render with a client ID so that you can target it:

     @grid.GetHtml(
         // code here
         htmlAttributes: new { id = "mygrid" }
     )
    

    Now add the styles using JQuery with the :contains selector:

    <script>
        // select the column named "Name" and update its width
        var idx = $("#mygrid th:contains('Name')").attr("width", 100);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem. I have a stored procedure that transforms normalized data into
I have a stored procedure that I want to call from within another, and
i have a stored procedure that has to retrieve data from multiple tables something
I have the following stored procedure that I have to get data from: EXECUTE
I have a somewhat-long-running stored procedure being called from a PB application. I want
I have a stored procedure that selects from a table, two of the fields
I have stored procedure that insanely times out every single time it's called from
I have written a single stored procedure that returns 2 tables: select * from
The problem is I have a stored procedure that runs consistently in Sql Server
I have a mysql stored procedure from this ( google book ), and one

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.