I need help getting my events set up correctly. Here's what's going on.
I have a project where I don't know the number or location of GridViews until the user selects some options. I need to do this all on one asp page.
I have figured out that I can create and populate a GridView dynamically and add it to a placeholder's controls.
<asp:PlaceHolder ID="phTimeEntryDay" runat="server"></asp:PlaceHolder>
Protected WithEvents gvTimeEntry As GridView = New GridView()
I have added the edit and delete commands using code:
Dim cColumn As New CommandField
cColumn.ButtonType = ButtonType.Link
cColumn.CancelText = "Cancel"
cColumn.UpdateText = "Update"
cColumn.EditText = "Edit"
cColumn.DeleteText = "Delete"
cColumn.ShowEditButton = True
cColumn.ShowDeleteButton = True
cColumn.ShowCancelButton = True
In another project where I created the gridview at design-time, I can't find any code created to handle the events that I can copy to my project that does everything at run-time.
<asp:GridView ID="GridViewTimeSheet" runat="server" AllowSorting="True" AutoGenerateColumns="False"
ShowFooter="True" EmptyDataText="No Data Available.">
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
The only complete example I've found uses DataGrid in C# instead of GridView and there are enough differences in DataGrid and GridView that I can't adapt it completely.
Examples in VB or C# are fine if you have some.
Any help would be greatly appreciated.