|
-
Nov 14th, 2002, 12:15 PM
#1
Thread Starter
New Member
Datagrid Column Header
I have a Datagrid that I'm binding a dataset to, however I need to rename a couple column Headers(template columns) at run-time, based upon user interaction..
Datagrid1.Columns(1).HeaderText = "Heading #1"
Datagrid1.Columns(2).HeaderText = "Heading #2"
looks like it should work, but doesn't.
anybody have any solutions?
-
Nov 14th, 2002, 04:12 PM
#2
Hyperactive Member
I think you are trying to address the datagrid directly itself rather than the datagridtable style, here is an example of my own code which may help.
Dim ts1 As New DataGridTableStyle()
ts1.MappingName = "Properties"
' Add Property
Dim o1 As New DataGridTextBoxColumn()
o1.MappingName = "Property"
o1.Width = 0
ts1.GridColumnStyles.Add(o1)
' Add First line of Address
Dim o2 As New DataGridTextBoxColumn()
o2.MappingName = "Adr1"
o2.HeaderText = " First Line of Address"
o2.Width = 160
o2.NullText = ""
ts1.GridColumnStyles.Add(o2)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|