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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:07:05+00:00 2026-05-26T08:07:05+00:00

I have been using Gridview to display data.i set the width of each column

  • 0

I have been using Gridview to display data.i set the width of each column using Itemstyle but the Problem is that if the content of that column is bigger than the column width then it will automatically increase column width but i want to break the word if content is bigger than column width…plz help me….

  • 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-26T08:07:06+00:00Added an answer on May 26, 2026 at 8:07 am

    EDIT: Well after investigation it turns out that instead of span if we use div and add ‘word-wrap:break-word’ attribute to style it does the trick. Here is the sample: http://jsfiddle.net/amantur/UYAb7/

    PS:- But please note that word-wrap:break-word might not be supported by all browsers and version. If this poses a problem, I suggest you write a function that takes in a href and link text and create a link with first few chacters + … and set complete word as tooltip using title property of anchor element:

    public static string CreateLink(string url, string text){
        var linkText=text.Length>10?text.SubString(0,10) + "...":text;
        return string.Format("<a href=\"{0}\" title=\"{1}\">{2}</a>", 
                             url,text,linkText);
    }
    


    you can added inner content inside a span element and set its max-width property to the width of the column.

    Example:

    <Column>
        <ItemStyle Width="100" />
        <span style="max-width:100px;">
           <a href="http://google.com">Google It</a>
        </span>
    </Column>
    

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

Sidebar

Related Questions

I have a list view that is displaying data using the gridview. This list
I have been using Castle MonoRail for the last two years, but in a
I have been using ASP.NET for years, but I can never remember when using
I have tried to set up combo boxes in the gridview but all the
Figure there is a simple solution to this problem but I have been unable
I've been struggling with a problem that I have for days now and I
I have a Gridview with AutoGenerateColumns=False . I am using a TemplateField to display
How can I add an Edit column in this GridView dynamically? I have been
I have been using gridview since a long time. I have a cant live
i have been trying to apply the Gridview Tutorial but i'm stuck in an

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.