Automatic change in the size of datagridview in shape and size of cells in software applications



  • There are two forms. On the first form, the daterid with the axes base. In the second form, the dategrid, where the headings in the form of a square matrix are filled ( https://ru.stackoverflow.com/questions/531862/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC-%D0%B7%D0%B0%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%B8%D1%8F-%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B9-%D0%B2-%D1%8F%D1%87%D0%B5%D0%B9%D0%BA%D0%B0%D1%85-datagridview ) How to make the grid of the cell automatically change the changes in size depending on the text, and then this is how: введите сюда описание изображения



  • We need to try something like this:

    gridview.AutoSizeColumnsMode = 
        DataGridViewAutoSizeColumnsMode.AllCells;
    gridview.AutoResizeColumns();
    

    gridview.AutoSizeRowsMode =
    DataGridViewAutoSizeRowsMode.AllCells;
    gridview.AutoResizeRows(
    DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders);




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2