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


Amitesh VermaRank #2,535 · 552 reputationPosted Aug 6, 2015, 2:04 AM EDT
Naeem KhanRank #2,072 · 698 reputationPosted Aug 6, 2015, 4:45 AM EDT
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);
Deep Siddharth Verma26 reputationPosted Aug 6, 2015, 4:58 AM EDT
here you can get