Datagrid and Dataset

papa_k

Member
Joined
Jun 1, 2009
Messages
22
Programming Experience
1-3
Hi,

When i sort a screen representation of my data (using the "click on column and it will order it" functionality built into the datagrid) my form displays the newly sorted data in the datagrid.

My datagrid is associated to a dataset.

The dataset underlying the data grid is not sorted the same as the datagrid.

Is there away to link the two so that when the datagrid order changes, the dataset changes also?

Or, is there a quick way to reference the data in the datagrid and assocaite it to its location in the dataset.

My code calls and adds data from one dataset to another dataset, rather than using datagrids.

At the time I thought this was a good idea, not so sure no.

Can someone help. If I need to give more details, please let me know.

Thanks,

Papa
 
You can not place a sort directly on the dataset however you do have several options. You can requery the data from the database to match the column header sort click or you can create a DataView and attach that to your datagridview. The DataView will allow you to sort by the columns you specify.
 
Currently, when a row is selected in a datagrid the row item number is used to access the dataset and insert that row into another dataset.

When i try to use the datagrid row information i get an error because i can not insert one datagrids data into another datagrid if the other datagrid has a data source of a dataset.

ideally i would like to data the datagrid information and then insert that information directly into my dataset that supports the data grid.

is that somethign that is easy to do?
 
Back
Top