Link to home
Start Free TrialLog in
Avatar of vensali
vensaliFlag for India

asked on

wrapping text in datagridview header columns

User generated imageI 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

 For Each col As DataGridViewColumn In dgv1.Columns
                col.DefaultCellStyle.WrapMode = DataGridViewTriState.True

dgv1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None
dgv1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells

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.
Avatar of ktaczala
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial