vensali
asked on
wrapping text in datagridview header columns
I have data grid view and i want get the above done. I have written the code like below.
For Each col As DataGridViewColumn In dtg.Columns
col.Width = dtg.Width / dtg.Columns.Count
Next
For Each col As DataGridViewColumn In dgv1.Columns
col.DefaultCellStyle.WrapM ode = DataGridViewTriState.True
Next
dgv1.AutoSizeColumnsMode = DataGridViewAutoSizeColumn sMode.None
dgv1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMo de.AllCell s
It is wrapping some of the columns correctly. but some col, text is getting truncated. screen shot is enclosed.
Request early help to solve this issue.
For Each col As DataGridViewColumn In dtg.Columns
col.Width = dtg.Width / dtg.Columns.Count
Next
For Each col As DataGridViewColumn In dgv1.Columns
col.DefaultCellStyle.WrapM
Next
dgv1.AutoSizeColumnsMode = DataGridViewAutoSizeColumn
dgv1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMo
It is wrapping some of the columns correctly. but some col, text is getting truncated. screen shot is enclosed.
Request early help to solve this issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.