Rotate DataGridView Header Text using C# in Windows Application

Last Reply 2 months ago By dharmendr

Posted 2 months ago

Hi!

I used dynamically header DataGridView. Now I want rotate90 degree for header text. 

Grid.AutoGenerateColumns = false;
Grid.Columns[0].DataPropertyName = "Kod";
Grid.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
Grid.Columns[0].HeaderCell.Style.Font = new Font("Palatino Linotype", 12.75F, FontStyle.Bold);
Grid.Columns[0].HeaderText = "Id";
Grid.Columns[1].DataPropertyName = "Name";
Grid.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
Grid.Columns[1].HeaderCell.Style.Font = new Font("Palatino Linotype", 12.75F, FontStyle.Bold);
Grid.Columns[1].HeaderText = "Name deport";
Grid.AllowUserToAddRows = false;
You are viewing reply posted by: dharmendr 2 months ago.