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">
-
-
class
="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">
-
-
class
="table table-bordered table-hover table-responsive table-striped table-condensed"> - Goods Desc
- Balance Units
-
- <%#Eval("ItemDesc") %>
- <%#Eval("InvoicBalanceUnits") %>
-
Bikesh SrivastavaPosted Nov 11, 2016, 12:00 AM
Madhanmohan DevarajanPosted Nov 10, 2016, 2:38 PM