<Columns> <asp:CommandField ShowSelectButton="True"/> </Columns>
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("ClearanceNumber"); dt.Columns.Add("CodeTrainId"); dt.Columns.Add("DateLastChange"); dt.Columns.Add("DateValidFrom"); dt.Columns.Add("DateValidTo"); dt.Columns.Add("ReservationNo"); dt.Columns.Add("TrainType"); dt.Columns.Add("CityCode"); dt.Columns.Add("Days"); DataRow dataRow; dataRow = dt.NewRow(); for (int i = 0; i < dataRow.Table.Columns.Count; i++) { dataRow[i] = GridView1.SelectedRow.Cells[i + 1].Text; GridView1.Rows[0].Cells[0].BackColor = System.Drawing.Color.Blue; } dt.Rows.Add(dataRow); Session["dataTable"] = dt; Response.Redirect("Selected.aspx"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)