Hi All,
hope you are well. and thank you in advance for any help you can give me on this.
I have a system, that requires a repeater created (with a new header) based on a value returned from the sql query
for example my table holds information like follows:
Field 1 | Field 2 | field 3
info 1 info 1
info info 1
info info 2
info info 2
info info 2
any idea how i would create a repeater dynamically (programmably) during runtime based on the contents of my data in database table
creating a repeater at runtime for all infomration or some is easy, but dont know how to create another one if field 3 changes value 2 - so for all entries with value 2 place in a repeater, all entries with value 1 create them into a repeater
hope this is coming across correctly. but since tomorrow there could be 6 entires with field value of 4, i want to it do the same again and group the 4's together..
so in other words create a repeater for every group of entiries with same value in field3
Front end code looks like follows:
<asp:Repeater ID="SKillsTOEnter" runat="server">
<HeaderTemplate>
<table width="50%">
<tr>
<th>Field1</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td width="80%"><Asp:label id="fieldinfo" Text=<%#DataBinder.Eval(Container.DataItem, "Field1")%> runat="server"></Asp:label></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Thanks in advance
Robert Belsten
What I have tried:
i can create a single asp repeater to pull them all , but not one to add a header when field 3 changes value or create a new repeater when value changes in field 3
Backend code
myCommand = New SqlDataAdapter("select Field1, field2, FIeld3 From Table1 Order By FIELD2 ", myConnection)
myCommand.Fill(ds)
SKillsTOEnter.DataSource = ds
SKillsTOEnter.DataBind()