Hello i have a repeater that will present data as a table with checkbox for each row, so i want to show the checked rows data when a button is clicked.
.aspx code:
- "rptItems" runat="server">
-
- ="table table-bordered table-hover table-responsive table-striped table-condensed">
-
-
-
- Goods Desc
- Balance Units
- Exit Units
-
-
-
-
-
- "cbItem" runat="server" />
-
- <%#Eval("ItemDesc") %>
- <%#Eval("InvoicBalanceUnits") %>
- "txtExitUnits" runat="server" >
- "revUnits" runat="server" Display="Dynamic" ControlToValidate="txtExitUnits" ValidationExpression="^\d+$" ErrorMessage="Please, insert a number." CssClass="text-danger">
- "rfvUnits" runat="server" Display="Dynamic" ControlToValidate="txtExitUnits" ErrorMessage="Insert number of units." CssClass="text-danger">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
the code behind:- protected void btnExit_Click(object sender, EventArgs e)
- {
-
- List selectedItems = rptItems.Items.Cast().Where(x => ((CheckBox)x.FindControl("cbItem")).Checked).ToList();
-
- epeater1.DataSource = selectedItems;
- Repeater1.DataBind();
Repeater1 will contain the data selected through :selectedItems
this is the repeater1
- "Repeater1" runat="server">
-
- ="table table-bordered table-hover table-responsive table-striped table-condensed">
-
-
-
- Goods Desc
- Balance Units
-
-
-
-
-
-
-
-
- <%#Eval("ItemDesc") %>
- <%#Eval("InvoicBalanceUnits") %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
when i run the code it gives me an error that "ItemDesc" isn't exist in repeater1, whats wrong ?