Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear friend,

I have one Doubt,

how to access value from one grid view Column to another grid view event(row Command)

i need get Menu_id from grid_view1
and pass to grid_view2.


Plz?

By mohan.
Posted

This might help, on one event you can call another event like this :

C#
<pre lang="cs">public void Control1_KeyDown ( object sender, System.Windows.Forms.KeyEventArgs e )
{
    if ( e./* something */ )
    {
        Button1Clicked();
    }
}

public void Button1_Click ( object sender, EventArgs e )
{
    Button1Clicked();
}

private void Button1Clicked ( )
{
    // do whatever you wanted to do in the Button_Click event
}

 
Share this answer
 
first generate the gridviewrow_command event
then write the following code
if(e.commandname=="edt")
{
Label1.Text = e.CommandArgument.ToString();
session["myid"]=label1.text;

}
by the above code a session variable myid is created you can use that any where in your application.
hope it is useful.
if it is useful to you please give reply to me.
from vikranth redddy
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900