I’m having huge issues with DataGridView rows.
I have a field in my datagrid which can have a lot of content, so I want each row to be a different height which I’m achieving using:
myGrid.AutoResizeRows(5);
I call this after adding the rows to the table and inside and Application.Update block.
It kinda works, in that the rows all size sensibly to fit their contents, but I see 2 issues.
Any thoughts ?
Am I missing some steps I need to perform to get this working correctly ?
Thanks,
Andi Gordon
Hi Andi,
actually it´s not a bug but expected behavior:
The call dataGridView1.AutoResizeRow(rowid); inside your loop does not have any effect as the rows are not on the client yet.
In order to make your sample work you can either set the AutoSizeRowsMode
this.dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
Here now further Resize call is needed.
Or you can set the BlockSize of the DataGridView higher because the resizing otherwise only applies to the client cache.
Best regards
Frank
Hi Andi,
any chance to wrap up a test case for us?
Best regards
Frank
Please login first to submit.