开发者

ASP.NET Gridview - How to display Headers to the left?

开发者 https://www.devze.com 2023-01-19 03:59 出处:网络
I need to display the colum开发者_运维百科n headers to the left within ASP.NET? Any ideas on how to do that?You can use the DetailsView, but it\'s designed to only show one record (or row) from the da

I need to display the colum开发者_运维百科n headers to the left within ASP.NET? Any ideas on how to do that?


You can use the DetailsView, but it's designed to only show one record (or row) from the datasource in a table like this:

Columname1  Value1 
Columname2  Value2
Columname3  Value3

Or do you mean you want to align the headertitles to the left? try this:

Gridview1.HeaderRow.HorizontalAlign=HorizontalAlign.Left;


You have to set the alignment on each bound field:

<asp:BoundField DataField="Source" HeaderStyle-HorizontalAlign="Left"  HeaderText="Source" />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号