Click here to Skip to main content
11,932,446 members (54,533 online)
Rate this:
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 is my code.
int Editid =Convert.ToInt16(GridView1.DataKeys[e.NewEditIndex].Values[0].ToString());
           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();
    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
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[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2015
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