HeaderText

mzim

Well-known member
Joined
Jun 3, 2004
Messages
187
Location
Other side of the rock
Programming Experience
1-3
hi to everyone,

i'd like to know how to center the headertext in DataGridTextBoxColumn?


thnks in advance and more power..
 
On the data grid properties, edit the TableStyles collection. Add a new style or edit an existing one if there is one. Click on the GridColumnStyles collection node edit button. There should be a down arrow next to the Add button, click this and select datagridtextboxcolumn. Near the bottom of the propertygrid there is an alignment attribute. That's the one u want.
 
see my attachment.
i want to put the headertext in the datagrid to be in the center of the column.

and oh. there is no property of headertext.center
VB.NET:
  Dim first As New DataGridTextBoxColumn()
 		first.Width = 100
 		first.MappingName = "First_Name"
 		first.HeaderText = "First Name"<-------- i want this to be in center of the column.
 		first.NullText = ""
 		t.GridColumnStyles.Add(first)
thanks in advance.
 

Attachments

  • head.JPG
    head.JPG
    4.3 KB · Views: 80
ok i try your suggestions but sorry to tell you this it wont work..

it is just like:
VB.NET:
 Dim address As New DataGridTextBoxColumn()
 		address.Width = 100
 		address.MappingName = "Address"
 		address.NullText = ""
 		address.HeaderText = "Address"
 		address.Alignment = HorizontalAlignment.Center<------it is just put the cursor in the middle of the column and not the headertext(address).
 
Back
Top