asp.net - Bind a multi-dimensional ArrayList to a Gridview -
I have a datagroup with a checkbox to provide a seat to provide seats, but in the button click event, if the check If the box is clicked, then I'm adding line contents to an Arrayist, then adding ArrayList to a session before redirecting to the confirmation page:
Secure Zero Reserve_Click (Object Sender, EventArgs e) {{ArrayList SeatAutria = New ArrayLi St (); {Grid Seat ID = (Gide) Gridview for (Int i = 0; I & lt; GridView1.Rows.Count; i ++) 1. Data [I] [0]; Check box cbReserve = (checkbox) GridView1. Traverse [i] .FindControl ("cbReserve"); Label lblSection = (label) GridView1.Rows [i] .FindControl ("lblSection"); Label lblRow = (label) GridView1.Rows [i] .FindControl ("lblRow"); Labeled lblPrice = (label) GridView1.Rows [i] .FindControl ("lblPrice"); If (cbReserve.Checked) {string tempRowInfo = lblSection.Text + "|" + LblRow.Text + "|" + LblPrice.Text; SeatingArreaList.Add (tempRowInfo); }} // Seats selected in a session ["Sitting"] = Add Seating Arrives; } Response.Redirect ("Confirm.aspx? ConcertId =" + Request.QueryString ["concertId"]); }
On the confirmation page, the ID wants to split this array and paste it into another individual gridview in its individual column.
On the confirmation page, there are three different columns with a pipe that exists in a session, I am dividing it and tying in a confirmation grid.
Please help!
It would be easy to create just a DataTable
, then in the session variable Add. Once redirected to the confirmation page, GridView
is drawn from the session variable with the DataTable
.
Secure void Reserve_Click (Object Sender, EventArgs E) {Datatable DT = New DataTable (); Dt.Columns.Add ("section"); Dt.Columns.Add ("line"); Dt.Columns.Add ("value"); {ArrayLight seatingAralyst = new array list (); {Grid Seat ID = (Gide) Gridview for (Int i = 0; I & lt; GridView1.Rows.Count; i ++) 1. Data [I] [0]; Check box cbReserve = (checkbox) GridView1. Traverse [i] .FindControl ("cbReserve"); Label lblSection = (label) GridView1.Rows [i] .FindControl ("lblSection"); Label lblRow = (label) GridView1.Rows [i] .FindControl ("lblRow"); Labeled lblPrice = (label) GridView1.Rows [i] .FindControl ("lblPrice"); If (cbReserve.Checked) {DataRow dr = dt.NewRow (); Dr. ["section"] = LLBsession Text; Dr. ["line"] = LBLRO Text; Dr. ["value"] = lblPrice.Text; Dt.Rows.Add (Dr.); }} // Selected Seats in a Session Season ["Sitting"] = DT; } Response.Redirect ("Confirm.aspx? ConcertId =" + Request.QueryString ["concertId"]); }
Comments
Post a Comment