N
Nikerz Inc
I would like to programically nest a repeater to do the following. The
tricky part is linking the data to these controls. I've been able to do
this coding the straight html which I would like to do away with because I
want to be able to change the control that appears as well.
Any help please!!!!
-----------------------------------------------------
Data 1 Radiobutton (text)
Radiobutton (text)
Radiobutton (text)
-----------------------------------------------------
Data 2 Checklist (text)
Checklist (text)
Checklist (text)
-----------------------------------------------------
Public Class MyTemplate
Implements ITemplate
Shared itemcount As Integer = 0
Dim TemplateType As ListItemType
Sub InstantiateIn(ByVal container As Control) _
Implements ITemplate.InstantiateIn
Dim lc As New Literal
lc.Text = "<br>"
AddHandler lc.DataBinding, AddressOf TemplateControl_DataBinding
itemcount += 1
container.Controls.Add(lc)
End Sub
Private Sub TemplateControl_DataBinding(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim lc As Literal
lc = CType(sender, Literal)
Dim container As RepeaterItem
container = CType(lc.NamingContainer, RepeaterItem)
lc.Text &= DataBinder.Eval(container.DataItem, "Response")
End Sub
End Class
tricky part is linking the data to these controls. I've been able to do
this coding the straight html which I would like to do away with because I
want to be able to change the control that appears as well.
Any help please!!!!
-----------------------------------------------------
Data 1 Radiobutton (text)
Radiobutton (text)
Radiobutton (text)
-----------------------------------------------------
Data 2 Checklist (text)
Checklist (text)
Checklist (text)
-----------------------------------------------------
Public Class MyTemplate
Implements ITemplate
Shared itemcount As Integer = 0
Dim TemplateType As ListItemType
Sub InstantiateIn(ByVal container As Control) _
Implements ITemplate.InstantiateIn
Dim lc As New Literal
lc.Text = "<br>"
AddHandler lc.DataBinding, AddressOf TemplateControl_DataBinding
itemcount += 1
container.Controls.Add(lc)
End Sub
Private Sub TemplateControl_DataBinding(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim lc As Literal
lc = CType(sender, Literal)
Dim container As RepeaterItem
container = CType(lc.NamingContainer, RepeaterItem)
lc.Text &= DataBinder.Eval(container.DataItem, "Response")
End Sub
End Class