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
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