can u please any one explain how to display selected rows of data from one gridview to another gridview using c sharp

hello, I 'm still a noob at programming in vb.net
I have a little problem. I 'm trying to get my selected rows to another page. I already can select my rows with checkboxes but I don't know how I can pass them through a session to another page.
hopefully someone can help me.

greetz

Are u using GridView control and get connected by database...
is that so..
then
u must be knowing Global.asax
inside session_start
declare a session variable..

Session["name"]=null;

On GridView_Selected change

int index = GridView1.SelectedIndex;
        for (int i = 1; i < GridView1.Rows[index].Cells.Count; i++)
        {
            Response.Write(GridView1.Rows[index].Cells[i].Text);
            Session["name"] += GridView1.Rows[index].Cells[i].Text+".";
        }

and how to retrive the value from session..

string[] splitData;
        if (Session["name"] == null)
        {
        }
        else
        {
            string valuefromsession = Session["name"].ToString();
            splitData = valuefromsession.Split('.');
            for (int i = 0; i < splitData.Length-1; i++)
            {
                Response.Write("Name :" + splitData[i].ToString() + "<br/>");
            }
        }

i hope this will help u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.