-1
No... maybe that’s it:
int s1 = 0;
int s2 = 0;
s1 = (Int32)dataGridView1.RowCount;
for (int i = 0; i < s1; i++)
{
s2 += dataGridView1.Rows[i].Height;
}
dataGridView1.Height = s1 * s2;
See also:
Datagridviewrowcollection.Getrowsheight(Datagridviewelementstates) Method
Didn’t look good... needs some adjustment...
Sorry, is this gray border filling field? Is there a star next to it (*)? I know! It’s short on records and it’s busy datagrid size!
– FabioIn
There’s no star, it’s like the leftover from what the datatable didn’t fill in.
– João Gabriel Campos Gurgel
Welcome to Sopt! Please explain the problem better, and if possible include a example of code that reproduces what is happening, because your question is not noticeable. See Help Center How to Ask.
– Lucas Duete
is that gray border at the end of Datagrid
– João Gabriel Campos Gurgel