' Create template Dim itemTemplate1 As New ItemTemplate() ' Instantiate template with button controls itemTemplate1.Template = New CustomTemplate() ' Add template to collection Me.WebDataGrid1.Templates.Add(itemTemplate1) ' Set template id CType(Me.WebDataGrid1.Templates(0), ItemTemplate).TemplateID = "WebDataGrid1Template1" Private Class CustomTemplate Implements ITemplate Public Sub InstantiateIn(ByVal container As Control) Dim b1 As New Button() Dim b2 As New Button() b1.Text = "Submit" b2.Text = "Cancel" container.Controls.Add(b1) container.Controls.Add(b2) End Sub End Class