Thursday, July 21, 2011

get the other columns data using command argument in grideview

 if (e.CommandName == "setfinactive")
        {
          
            //GridViewRow row = GridView2.Rows[index];

           GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).NamingContainer;

           LinkButton pEdit = (LinkButton)gvr.FindControl("lblcourseid");

            userid = e.CommandArgument.ToString();
            courseid = Convert.ToInt32(pEdit.Text);
           
            //con.Open();
            //cmd = new SqlCommand("update usercourse set FInactive1 = 4 where userid =   ");
            //con.Close();


        }

No comments:

Post a Comment