|
■No98113 (Yammaer さん) に返信
こんな感じ
Class MyItemTemplate
Implements ITemplate
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) _
Implements System.Web.UI.ITemplate.InstantiateIn
Dim lblSyoruiName As New Label
lblSyoruiName.ID = "lblSyoruiName"
AddHandler lblSyoruiName.DataBinding, AddressOf lblSyoruiName_DataBind
container.Controls.Add(lblSyoruiName)
End Sub
Sub lblSyoruiName_DataBind(sender As Object, e As EventArgs)
Dim label = DirectCast(sender, Label)
Dim container = DirectCast(label.BindingContainer, IDataItemContainer)
label.Text = Convert.ToString(DataBinder.Eval(container.DataItem, "SyoruiName"), CultureInfo.CurrentCulture)
End Sub
End Class
|