I have a repeater set up to extract and display data from a SQL Server database. Each row in the database has corresponding buttons added to it.
Below is the code used to populate the repeater:
SqlConnection connR;
string connectionStringR = ConfigurationManager.ConnectionStrings[
"BallinoraDBConnectionString1"].ConnectionString;
connR = new SqlConnection(connectionStringR);
SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Events", connR);
DataTable dt = new DataTable();
sda.Fill(dt);
Repeater1.DataSource = dt;
Repeater1.DataBind();
And here is the Repeater code:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<div>
<table>
<tr><th><%#Eval("Event_Title")%></th><td><button>Edit</button></td><td><button>Delete</button></td></tr>
<tr><td>Event Group ID</td><td><%#Eval("Event_Group_Id") %></td></tr>
<tr><td>Event Type</td><td><%#Eval("Event_Type") %></td></tr>
<tr><td>Event ID</td><td><%#Eval("Event_Id") %></td></tr>
<br />
</table>
</div>
</ItemTemplate>
</asp:Repeater>
Here is the UI I'm uncertain about where to incorporate the Edit and Delete functionality for each row since the number of events displayed depends on the number of rows in the database.