|
Nesting Datagrid Repeater DataList can be easily done. Any of these components can
be nested within each other.
here's a code that nests a CheckedListBox within a repeater.
<table cellpadding="0" cellspacing="0" border="1">
<asp:Repeater ID="dlProcedures" runat="server">
<ItemTemplate>
<tr>
<td>
<%#Container.DataItem("CATEGORYNAME")%>
<asp:CheckBoxList ID="cblProc" runat="server" RepeatColumns=&
quot;4" DataTextField="ProcedureName" DataValueField="ProcedureCode"
DataSource='<%#GetProcedureList(Container.DataItem("CATEGORYCODE"))%>'
></asp:CheckBoxList>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
Code Behind -
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Me.Load
If Not IsPostBack Then
Dim oCategory As New cCategory
Dim oDataSet As New DataSet
oDataSet = oCategory.GetCategoryList
dlProcedures.DataSource = oDataSet.Tables(0)
dlProcedures.DataBind()
End If
End Sub
Public Function GetProcedureList(ByVal ProcedureCode As String) As DataTable
Dim oProcedure As New cProcedure
Dim odataset As New DataSet
odataset = oProcedure.GetProcedureByCategory(ProcedureCode)
Return odataset.Tables(0)
End Function
|