Private Class CustomItemTemplate Implements ITemplate #Region "ITemplate Members" Public Sub InstantiateIn(container As Control) Implements ITemplate.InstantiateIn Dim label1 As New Label() label1.ID = "TemplateLabel" ' DataItem からセル値を取得します。 label1.Text = DirectCast(DirectCast(container, TemplateContainer).DataItem, DataRowView)("CustomerID").ToString() container.Controls.Add(label1) End Sub #End Region End Class