Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
i hav use autogenerate adit link in gridview.i have write code that ,when i click on edit link data on that line comes in textbox.here is my code.
 int Editid =Convert.ToInt16(GridView1.DataKeys[e.NewEditIndex].Values[0].ToString());
            objdal.Editid=Editid;
            dv=objdal.Edit_Data();
 
            ddlGroupName.SelectedValue= dv.Table.Rows[0]["Groupid"].ToString();
            ddlName.SelectedValue = dv.Table.Rows[0]["Name"].ToString();
            txt_LeaveFrom.Text = dv.Table.Rows[0]["LeaveFrom"].ToString();
            txt_LeaveTo.Text = dv.Table.Rows[0]["LeaveTo"].ToString();
           
Edit_data() function.....
 
 
        public DataView Edit_Data()
        {
 
            cmd = new SqlCommand("LeaveForm_Select_Data", cnn);
            cmd.CommandType = CommandType.StoredProcedure;
 

            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
 
            DataView dv = new System.Data.DataView();
            dv.Table = ds.Tables[0];
            return dv;
 
        
        
 
        }
 
 

when i click on edit datacomes in textbox.but when i click on other edit link at the same time,Update and Cancle link autometicaly genrate at row which i have click first one.
what is solution for that.
Posted 31-Jan-13 19:38pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi check this link
 

and go to "Get Code for this sample.." link there you can get the clear picture
 
Row edit[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,142
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100