0

When I change the RowTemplate.Height if will effect every row exept the last one. That one will still be on the original row size 25. I get my rows from a database and here is the code.

bool check = false;
            SqlCommand com = new SqlCommand();
            com.Connection = _sqlcon;
            com.CommandType = CommandType.StoredProcedure;
            com.CommandText = "PRO_SHOWDATAGRID";
            SqlDataAdapter da = new SqlDataAdapter(com);
            DataSet ds = new DataSet();
            da.Fill(ds);
            dtgvProducten.RowCount = ds.Tables[0].Rows.Count;
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
                {
                    dtgvProducten.Rows[i].Cells[j].Value = ds.Tables[0].Rows[i].ItemArray[j];
                    check = true;
                }
            }
            com.Dispose();
            return check;

And here is a picture of the data grid view:

enter image description here

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61
Bart
  • 31
  • 3
  • In the DGV is the last row where you add new data? When a DGV is set to allow user to add new rows the last row is blank. – jdweng Mar 18 '21 at 10:38
  • Yes the last row is the last one where i add new data. – Bart Mar 18 '21 at 12:12
  • See if any of the answers here helps : https://stackoverflow.com/questions/3370236/changing-the-row-height-of-a-datagridview Sometimes the DGV gets corrupted and deleting and adding a new DGV sometimes helps. – jdweng Mar 18 '21 at 12:21

0 Answers0