Hello friends,
i have one gridview and adding rows at run time when i click on button. what i want to do when i click on button row should be on top. for example if student name come in first row Naeem and 2nd Row Come Karthik now what i want when i add karthik it should be come on first not last .
last record should be selected and come on top.. is it possible then reply me ASAP..
thanks in advance

Deep Siddharth VermaPosted Aug 6, 2015, 8:58 AM
here you can get
Naeem KhanPosted Aug 6, 2015, 8:45 AM
MySqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
gv_show_details.Rows.Add();
gv_show_details.Rows[i].Cells[0].Value = dr[0].ToString();
gv_show_details.Rows[i].Cells[1].Value = dr[1].ToString();
gv_show_details.Rows[i].Cells[2].Value = dr[2].ToString();
gv_show_details.Rows[i].Cells[3].Value = dr[3].ToString();
gv_show_details.Rows[i].Cells[4].Value = dr[4].ToString();
gv_show_details.Rows[i].Cells[5].Value = dr[5].ToString();
gv_show_details.Rows[i].Cells[6].Value = dr[6].ToString();
i++;
}
con.Close();
gv_show_details.ReadOnly = true;
gv_show_details.Sort(gv_show_details.Columns[1], ListSortDirection.Descending);
Amitesh VermaPosted Aug 6, 2015, 6:04 AM