Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems Adding a EditCommandColumn Programatically

Status
Not open for further replies.

prgmrgirl

Programmer
Joined
Feb 12, 2004
Messages
119
Location
US
Hi guys,

I'm trying to create a datagrid at load time and everything is working except the adding of the EditCommandColumn. Here is my code for adding it:

Public Function CreateButtonColumn() As EditCommandColumn
Dim editCol As New EditCommandColumn

editCol.ButtonType = ButtonColumnType.LinkButton
editCol.EditText = "Edit"
editCol.CancelText = "Cancel"
editCol.UpdateText = "Update"
editCol.ItemStyle.HorizontalAlign = HorizontalAlign.Center

Return editCol
End Function

Then, in the calling routine I add it to the datagrid:
'add the button column
dg.Columns.Add(CreateButtonColumn())

I am getting the following message and not quite understanding what's going on:

'DataGridLinkButton' must be placed inside a form tag with runat=server

What does this mean? What am I doing wrong? (or not doing?)

Thanks!

prgmrgirl
 
Where is the code that adds the dg to the form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top