I have a DataGridViewX1 when get its data from Datatable. Now i want to sort it when the clerk add data to sql, DataGridViewX1 automatically sort and show new row.
i tested this code but it isn't correct.
//Fill datatable
adp = new SqlDataAdapter("FillDataGridViewWithClerk", conn);
adp.Fill(dtbl);
grd.AutoGenerateColumns = false;
DataView view = dtbl.DefaultView;
view.Sort = "clrk_Name, clrk_Family asc";
grd.DataSource = view;
Loading
Akkiraju IvaturiPosted Jan 15, 2013, 10:43 AM
Put a timer in your page and let it invoke the datagridview binding code for every time interval so that it picks up the latest data inserted in the table.
Otherwise, your asp.net page cannot refresh by itself to get the latest data. Unless you do some operation that post backs the page.
Let me know if you have any questions.