hi,
this is an sample code you can use
you can use
OnRowCommand="Countrylist_RowCommand"
in c#
protected void Countrylist_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditRow")
{
string strCode = (string)e.CommandArgument;
txt_countryid.Text = strCode;
con.Open;
DataSet ds = new DataSet();
OleDbDataReader reader = null;
OleDbCommand cmd = new OleDbCommand();
cmd = new OleDbCommand("select * from Country_master where CountryId=" + strCode + "", con);
reader = cmd.ExecuteReader();
while (reader.Read())
{
txt_countrycode.Text = reader["CountryCode"].ToString();
txt_countryname.Text = reader["CountryName"].ToString();
}
con.Close();
}
}
Hope this Helps you
happy coding :)