hello i am trying to pass values from gridview to another form but my problem is that when i make the coloumn visible=false, data of this column is to showing up so any help how can i get value of coloumn even if the coloumn is unvisible..
my grid view data :
- <ItemTemplate>
- <asp:Button ID="Button1" Text="Edit" runat="server" BorderStyle="None" OnClick="Send" ForeColor="CornflowerBlue" CssClass="button1" OnClientClick = "SetTarget();" Width="50px"/>
- </ItemTemplate>
- </asp:TemplateField>
and on page load of this page :
- protected void Page_Load(object sender, EventArgs e)
- {
- Label1.Visible = false;
-
-
- if (!IsPostBack)
- BindGrid();
-
- GridView1.Columns[0].Visible = false;
- GridView1.Columns[1].Visible = false;
- }
and the send edit button here i tried to show the coloumn and send the data with the button but it didnt work:
- protected void Send(object sender, EventArgs e)
- {
-
-
- Button btnSend = sender as Button;
-
-
-
- GridViewRow row = btnSend.NamingContainer as GridViewRow;
-
-
-
- GridView1.Columns[1].Visible = true;
- Session["Row"] = row;
-
-
- Response.Redirect("EditAddPack.aspx");
- }
finally my another page load iam getting the data like this with all the columns that are only visible = true;
- if (Session["Row"] != null)
- {
-
- GridViewRow row = Session["Row"] as GridViewRow;
-
-
-
- editstdidlbl.Text = row.Cells[1].Text;
- editCoachdroplist.SelectedValue = row.Cells[2].Text;
- editSTDDropDownList.SelectedItem.Text = row.Cells[3].Text;
-
- editSessiontxt.Text = row.Cells[4].Text;
- editpackDropDownList.SelectedValue = row.Cells[5].Text;
- editamounttxt.Text = row.Cells[6].Text;
- editstarttxt.Text = row.Cells[7].Text;
- editStatusDropDownList.SelectedValue = row.Cells[8].Text;
- editremarkid.Value = row.Cells[9].Text;
-
-
-
- }
Please Help!!