I'm trying to update/refresh my data grid but it doesn't seem to update whenever there's a new entry. I've search the net about it and they were talking about databind(). I can't seem to have that in my datagrid. My intellisense only shows DataBindings not databind(). here's my code (when button is clicked):
dataGridRecords.DataSource = null;
dataGridAlarm.DataSource = null;
dataGridViolations.DataSource = null;
dataGridDriverInf.DataSource = null;
dataGridRecords.DataSource = dbc.ds.Tables["Records"].DefaultView;
dataGridViolations.DataSource = dbc.ds.Tables["Violations"].DefaultView;
dataGridDriverInf.DataSource = dbc.ds.Tables["DriverInfo"].DefaultView;
then i also tried this (i've also tried refresh(),refreshedit()):
dataGridRecords.DataSource = null;
dataGridAlarm.DataSource = null;
dataGridViolations.DataSource = null;
dataGridDriverInf.DataSource = null;
dataGridRecords.Update();
dataGridViolations.Update();
dataGridDriverInf.Update();
dataGridRecords.DataSource = dbc.ds.Tables["Records"].DefaultView;
dataGridViolations.DataSource = dbc.ds.Tables["Violations"].DefaultView;
dataGridDriverInf.DataSource = dbc.ds.Tables["DriverInfo"].DefaultView;
can anyone tell me how to get this right? it's not updating.