Programically nesting a repeater

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top