datadrid to dataset

  • Thread starter Thread starter orencs
  • Start date Start date
O

orencs

Hi all,

I am binging a dataset to a datagrid(datasource) and display the
result in a a datagrid on a win form.

The datagrid displayes few columns.
The user can sort the table by clicking the header of each column.

The problem:
After the user sort the grid I want to update the dataset accordingly
because I print it.

How do I update the datagrid datasource? It seems like the datasource
does not changed although the datagrid displays new sorted table.

How do I update the dataset with the effected changes in the datagrid
source?

Thanks in advance
Oren
 
Hi,

Are you talking about sort order?
If you are binding datatable as datasource then the real source is
DataTable.DefaultView.
 
well I have tried that it does not work
What I am tring to do is
1. I have a dataset which I bind to a datagri
2. The user can sort the datagrid columns by clicking their headers
3. The user can print the datagrid content

I need to update the dataset according to the changes in the UI
The print method get dataset and print it
I want to print the data as was viewed in the UI.
 
Back
Top