Vertical Text in Datagridview Header
Posted on 2013-02-02
I have a datagridview that I need to put the header text vertically. I have found a few things on here and using Google, but nothing seems to work. This is the latest thing I have tried, but it doesn't even seem to fire off:
Private Sub dataGridView1_CellPainting(sender As Object, e As DataGridViewCellPaintingEventArgs)
If e.RowIndex = -1 AndAlso e.ColumnIndex = 0 Then
e.Graphics.DrawString(e.FormattedValue.ToString(), e.CellStyle.Font, Brushes.Black, 5, 5)
e.Handled = True
Can this even be done? Why is vertical text anywhere so difficult in VB.NET? Thanks for any help you can give me on this.