M
Martin
Hi, I can use DataGridView with a database table, that works pretty
well - when I programatically add a new row (using DataTable.AddRow()
and TableAdapter.Update()) to the datatable it shows in the
DataGridView, when I delete it (using DataRow.Delete() and
TableAdapter.Update()), then it automatically disappears from the
DataGridView.
Now I need to show a database view in the DataGridView. But the view
is read-only of course, I can only change the tables that the view is
using. So now how can the DataGridView find out that the view content
has changed and update its own content when I change one of the view's
tables?
I found only one solution - manually call TableAdapter.Fill on the
view, but that clears the view and loads it again from the database -
that means that the DataGridView loses track of position of the cursor
and position in the list... is there any other solution that would act
as acts a table in the DataGridView?
well - when I programatically add a new row (using DataTable.AddRow()
and TableAdapter.Update()) to the datatable it shows in the
DataGridView, when I delete it (using DataRow.Delete() and
TableAdapter.Update()), then it automatically disappears from the
DataGridView.
Now I need to show a database view in the DataGridView. But the view
is read-only of course, I can only change the tables that the view is
using. So now how can the DataGridView find out that the view content
has changed and update its own content when I change one of the view's
tables?
I found only one solution - manually call TableAdapter.Fill on the
view, but that clears the view and loads it again from the database -
that means that the DataGridView loses track of position of the cursor
and position in the list... is there any other solution that would act
as acts a table in the DataGridView?