Search code examples
c#datagridviewcell

Can't scroll to bottom of a cell in the datagridview


In my datagridview, there is one cell that contains quite a few rows of text: enter image description here

If you notice in the image, the scrollbar is all the way at the bottom, but if you look closely at the 'Text' cell, there is text that isn't completely displayed. I am using this code (below) to autoformat the rows in the grid:

// Autoformat of cells.
this.dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;

What else can I try so that all the text is visible in the cell?


Solution

  • On your image, we can see that the scroll bar is relative to the form and not to the datagridview.

    Modify the Dock property of the DataGridView to DockStyle.Fill to see the datagridview's scroll bar instead of the form one.