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
?
From MSDN -
Try
mydatagrid.Items.Refresh()
Reload the datasource of your grid after the update
Bind you Datagrid to an ObservableCollection, and update your collection instead.
How about
I had a lot of trouble with this and this is what helped me get the DataGrid reloaded with the new values. Make sure you use the data type that your are getting the data from to get the latest data values.
I represented that with
SomeDataType
below.Hope this helps someone with the same issues I had.