<td class="field1"><asp:CheckBox ID="CheckBox1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PersonnelSummary_Cleveland_Resident") %>'/></td> <td class="field1"><asp:CheckBox ID="CheckBox2" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PersonnelSummary_Present") %>' /></td> <asp:Button ID="btnAddAnother" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Button") %>' CommandName='<%# DataBinder.Eval(Container.DataItem, "Button") %>' />
public void Rptr_ItemCommand(Object source, RepeaterCommandEventArgs e) { int Total = Rptr.items.Count; if (e.CommandName == "Add") { Total = Total + 1; AddColumns(); foreach (Repeater item in Rptr.Items) { CheckBox PSR = ((CheckBox)item.FindControl("txtPSR")); CheckBox PSP = ((CheckBox)item.FindControl("txtPSP")); Button btnAdd = ((Button)item.FindControl("btnAddAnother")); } tb.Rows.Add(PSR,PSP, "Add"); } else if (e.CommandName == "Remove") { Total = Total -1; CheckBox PSR = ((CheckBox)item.FindControl("txtPSR")); CheckBox PSP = ((CheckBox)item.FindControl("txtPSP")); Button btnAdd = ((Button)item.FindControl("btnAddAnother")); } } public void AddColumns() { tb.Columns.Add("PSR", typeof(bool)); tb.Columns.Add("PSP", typeof(bool)); tb.Columns.Add("Button") } public void ButtonAdd_Click(object sender, EvenetArgs args) { AddColumns(); tb.Rows.Add(bool, bool, "Add"); btnAddAnother.Visible = false; }
tb.Rows.Add(bool, bool, "Add");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)