Datagridview column - wrap long text.

Posted on 2006-06-04
Last Modified: 2012-06-27
I have set the datagridview property as follow:

            dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;

but there is one particular column where the length of string is long and
i would like to fixed the width of this column and let the text wrap to the next line.

Any suggestion on how this can be done?
Question by:michellechan57
    LVL 26

    Accepted Solution

    Try this..

    Make sure that the column of the DataGrid has the ItemStyle Wrap property explicitly set to True

    <ItemStyle Wrap="True"></ItemStyle>

    Author Comment

    I am using DataGridView and window form application.
    There is no ItemStyle Wrap property for DataGridView.

    Author Comment

    Seems tougher than I thought.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now