G
Guest
Hi folks. Hoping for some help on a issue that has stalled my programming
efforts.
My app. presents a mailing list to the user and allows them to change the
status of the members of the mailing list (i.e. "Active", "Mail Returned",
"Requested Removal") etc.
I have a Access database, from which I create a DataSet with one table. I
create a DataView and set it as the DataSource to a DataGrid on my Windows
form.
I let the user sort by clicking on any column header. I capture the
DataGrid.MouseDown event and run a HitTest to see if the user clicked on a
HitTestType.ColumnHeader and if they did, I set the (DataView.Sort =
ColumnName. )
I've set the Status column to a custom GridColumnStyle which inherits from
DataGridTextBoxColumn and adds ComboBox functionality (cut and paste from an
internet example). The Combobox lets the user choose one of the pre-set
status values allowed.
Enough background, all that works fine. When the combobox changes its
value, it calls
This changes the cell in the DataView. The correct value appears in the
DataGrid. However, the DataTable which underlies the DataView does not have
its cell updated. Next time I sort, the DataView sorts its rows based on the
DataTable (as expected), but the value in the DataView cell (which is
different) now appears out of sort order.
But that's just a symptom of the problem, because what I want to do is
change the value in the datatable and update my Access database with the new
value. The app's point is to let the user change the status of the
mailinglist members...
SO, my question is; How can I get the column to change the underlying
DataSet/DataTable?
Thanks everyone for your time and help.
Darryl.
efforts.
My app. presents a mailing list to the user and allows them to change the
status of the members of the mailing list (i.e. "Active", "Mail Returned",
"Requested Removal") etc.
I have a Access database, from which I create a DataSet with one table. I
create a DataView and set it as the DataSource to a DataGrid on my Windows
form.
I let the user sort by clicking on any column header. I capture the
DataGrid.MouseDown event and run a HitTest to see if the user clicked on a
HitTestType.ColumnHeader and if they did, I set the (DataView.Sort =
ColumnName. )
I've set the Status column to a custom GridColumnStyle which inherits from
DataGridTextBoxColumn and adds ComboBox functionality (cut and paste from an
internet example). The Combobox lets the user choose one of the pre-set
status values allowed.
Enough background, all that works fine. When the combobox changes its
value, it calls
SetColumnValueAtRow(CurrencyManager, rowNum, ColumnComboBox.Text)
This changes the cell in the DataView. The correct value appears in the
DataGrid. However, the DataTable which underlies the DataView does not have
its cell updated. Next time I sort, the DataView sorts its rows based on the
DataTable (as expected), but the value in the DataView cell (which is
different) now appears out of sort order.
But that's just a symptom of the problem, because what I want to do is
change the value in the datatable and update my Access database with the new
value. The app's point is to let the user change the status of the
mailinglist members...
SO, my question is; How can I get the column to change the underlying
DataSet/DataTable?
Thanks everyone for your time and help.
Darryl.