So i have a main forum and a few child forums. For the main form, im using a search textbox with a dataview row filter. Although the problem is that in my child form im updating the database records, and then have to come back to the main form and have the DataGridView updated with the new records.
But when i try that, the datagridview isnt showing me an updated view even when i hard code DataView Filter.
public void RefreshDGV()
{
//Method thats being called from child form
SQL_Data.table.Clear();
this.dataGridView1.RowCount = 1;
this.dataGridView1.Rows.Clear();
this.Refresh();
this.dataGridView1.Refresh();
this.DataGridFill();
AptSearchRefill();
}
//Function that needs to set up a new view to show new/updated records
public void AptSearchRefill()
{
try
{
DataView dvrefresh = new DataView(SQL_Data.table);
dvrefresh.RowFilter = string.Format("apt_num LIKE '%{0}%'", apt_search.Text);
//Problem lies here^ Even when apt_search.text is hardcoded, still nothing.
dataGridView1.DataSource = dvrefresh;
}
catch (Exception ex)
{
WriteToLog.Write(ClassName, ex.ToString(), StoreUser.Username.ToString());
}
}