Session
-
I have a Datagrid. I am taking a selected row to the datatable(session).My problem is inside the datagrid in one cell there is a textbox. the value from the textbox is not binding to datatable. Can anybody help please.
Hi, Can you post your code how do u store rows in the session?
Thanks and Regards, Chetan Ranpariya
-
Hi, Can you post your code how do u store rows in the session?
Thanks and Regards, Chetan Ranpariya
DataTable dt = new DataTable(); dt.Columns.Add("feild1", System.Type.GetType("System.Int32")); dt.Columns.Add("feild2", System.Type.GetType("System.String")); dt.Columns.Add("feild3", System.Type.GetType("System.String")); dt.Columns.Add("feild4", System.Type.GetType("System.String")); dt.AcceptChanges(); DataRow l_rowDetails = dt.NewRow(); l_rowDetails["feild1"] = (GridView1.SelectedRow.Cells[1].Text); l_rowDetails["feild2"] = GridView1.SelectedRow.Cells[2].Text; l_rowDetails["feild3"] = GridView1.SelectedRow.Cells[3].Text; l_rowDetails["feild4"] = GridView1.SelectedRow.Cells[4].Text; dt.Rows.Add(l_rowDetails); dt.AcceptChanges(); Session["datatable"] = dt;
-
DataTable dt = new DataTable(); dt.Columns.Add("feild1", System.Type.GetType("System.Int32")); dt.Columns.Add("feild2", System.Type.GetType("System.String")); dt.Columns.Add("feild3", System.Type.GetType("System.String")); dt.Columns.Add("feild4", System.Type.GetType("System.String")); dt.AcceptChanges(); DataRow l_rowDetails = dt.NewRow(); l_rowDetails["feild1"] = (GridView1.SelectedRow.Cells[1].Text); l_rowDetails["feild2"] = GridView1.SelectedRow.Cells[2].Text; l_rowDetails["feild3"] = GridView1.SelectedRow.Cells[3].Text; l_rowDetails["feild4"] = GridView1.SelectedRow.Cells[4].Text; dt.Rows.Add(l_rowDetails); dt.AcceptChanges(); Session["datatable"] = dt;
Hi, Here u r pushing text of the cell. If u want to take value from the textbox then you should find textbox in the cell and then take its text property and insert it in to the table.
Thanks and Regards, Chetan Ranpariya