Hi,
i have an datagrid that works. the columns are autogenerated and i've added an editcommandcolumn in the aspx-file.
this works.
however when i move the editcommandcolumn to the aspx.vb-file
when i click on the edit, the "column" is removed.
my code is:
Private Sub AddColumnsToGrid()
Dim theEdit As New EditCommandColumn
theEdit.ButtonType = ButtonColumnType.LinkButton
theEdit.CancelText = "Cancel"
theEdit.EditText = "Edit"
theEdit.UpdateText = "Update"
theGrid.Columns.Add(theEdit)
End Sub
and in the page_load i call this procedure.
my aspx-snippet:
<asp
atagrid id=theGrid runat="server" OnSortCommand="SortByColumn" OnEditCommand="DataGrid_Edit" OnUpdateCommand="DataGrid_Update" OnCancelCommand="DataGrid_Cancel" OnItemCommand="DataGrid_Command"
AutoGenerateColumns = "True"
ShowFooter = "True"
EnableViewState="True"
CssClass = "datagrid"
AllowSorting = "True">
<AlternatingItemStyle CssClass="datagridalternatingitem"/>
<ItemStyle CssClass="datagriditem"/>
<HeaderStyle CssClass="datagridheader"/>
<PagerStyle CssClass="datagridpager"/>
</asp
atagrid>