Datagridview Cell Not Displaying all Characters RRS feed

  • Question

  • Hello

    I'm working on a project within visual studio 2015 and coding in I have a datagridview that displays data from an MS Access database. There is a field name "Condition" in the database that is in long text.

    There is another form where the user inputs the data and then it entered into the database. The issue I'm having is when the user opens the application that I have created in visual studio, the cell in the datagridview that shows the Condition field is truncating the data. Interestingly when I actually view the access database, I see everything that the user entered.  I would like to know if there is a maximum number of characters that a cell in the datagridview can display? If not , then what code or property can I use to increase the amount of characters the cell will display? One of the cells that is being truncated has a character count of 254. Any help will be appreciated.

    Thank You

    Saturday, December 14, 2019 11:46 PM


All replies

  • Hi

    You can set the Column that the long text is in to Wrap the text and so see it all.

    For example, a DataGridView1 with a Column called Description

    DataGridView1.Columns("Description").DefaultCellStyle.WrapMode = DataGridViewTriState.True


    If the long text is still within the bounds of screen size, you could try this instead (this could cause columns to the right to be a loooooong way off)

    DataGridView1.Columns("Description").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill

    Regards Les, Livingston, Scotland

    Saturday, December 14, 2019 11:56 PM
  • An elegant method is to data bind the column with long text to a TextBox under the DataGridView is how most developer do this.


    ConditionTextBox.DataBinding.Add("Text", someDataTable,"Condition")

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Sunday, December 15, 2019 12:13 AM
  • Thanks I'm going to give this a try.
    Sunday, December 15, 2019 12:39 AM
  • Hi,

    Did you resolve the issue? I think the replies above can provide you solutions.

    If you have resolved the issue then please mark the post or posts that helped you as The Answer using the Mark as Answer link at the bottom of the post. Marking answers will help other community members find solutions in the future.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, December 16, 2019 1:40 AM
  • What I did was allow the user to click on an area of the grid that would then open a form that would contain textboxes that had all of the data stored for that record. I still don't know why the datagridview would not show all of of the text, but at least now users can view everything that was entered.
    Tuesday, December 17, 2019 12:45 AM