Vertical text in datagridview

前端 未结 4 1848
孤城傲影
孤城傲影 2020-12-16 18:03

I want to show the text in the header cells in vertical orientation. How can I do it?

Thanks

4条回答
  •  时光说笑
    2020-12-16 18:34

    DataGrid d = new DataGrid();
    d.Columns[0].HeaderStyle.VerticalAlign = VerticalAlign.Bottom;
    

    If you are looking for gridview then you case like this :-

    GridView gv = new GridView ();
    gv.Columns[0].ItemStyle.VerticalAlign = VerticalAlign.Bottom;
    

    If you are looking for datagridview then you case like this :- Create an object of datagridview.

    gv.Columns["ColumnName"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.BottomCenter;
    

提交回复
热议问题