Moderator71
Moderator71

Reputation: 395

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

I need to display the column headers to the left within ASP.NET? Any ideas on how to do that?

Upvotes: 1

Views: 2760

Answers (2)

Vijay Bansal
Vijay Bansal

Reputation: 783

You have to set the alignment on each bound field:

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

Upvotes: 0

Willem
Willem

Reputation: 5404

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;

Upvotes: 2

Related Questions