Make Column Titles from a Textbox

What changes do I need to make to the text below, so that I can use the text from within a textbox to become the column header text for my newly created column?

PrivateSub Insert_Button_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Insert_Button.Click

' Initialize the button column.

Dim InsertAsNew DataGridViewButtonColumn

With Insert

.HeaderText ="Details"

.Name ="Details"

.Text ="View Details"

' Use the Text property for the button text for all cells rather

' than using each cell's value as the text for its own button.

.UseColumnTextForButtonValue =True

EndWith

' Add the button column to the control.

DataGridView1.Columns.Insert(4, Insert)

EndSub

Thanks


[2215 byte] By [ykgreene] at [2007-12-23]
# 1

.HeaderText = TextBox1.Text

DMan1 at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...