How to refresh datagrid in WPF

Johniek Comp picture Johniek Comp · Jul 4, 2012 · Viewed 103.6k times · Source

My source is in a MySQL database, I've made an update command and now I need to refresh my DataGrid.

MySqlCommand cmd = new MySqlCommand(
  "update request set status = " + StatusRequest(value) + 
  " where id = " + rowView[0].ToString() + "", conn);
MySqlDataReader myReader = cmd.ExecuteReader();

How do I refresh my DataGrid?

Answer

abramlimpin picture abramlimpin · Jul 4, 2012

Try mydatagrid.Items.Refresh()