DataGrid and sorting

G

Guest

I'm trying to produce a simple application that reads XML into a DataSet which is displayed in a DataGrid. My intention was to sort a table by clicking on the column headers and write the sorted rows from the DataSet back to the XML file. The input works fine. In the method that handles the MouseDown event I'm sorting rows by creating a DataView based on the table in the DataSet. The entries in the Dataview appear to be sorted, but when I try to assign the DataView as the datasource for the DataGrid and write the XML file from the DataSet the rows appear in the original order. Somehow the sorted rows do not appear to have found their way to the DataSet. Does anyone have any suggestions?
 
E

EMW

Maybe you could update the dataset first and then write it to xml?

_
Eric

Mike Perreten said:
I'm trying to produce a simple application that reads XML into a DataSet
which is displayed in a DataGrid. My intention was to sort a table by
clicking on the column headers and write the sorted rows from the DataSet
back to the XML file. The input works fine. In the method that handles the
MouseDown event I'm sorting rows by creating a DataView based on the table
in the DataSet. The entries in the Dataview appear to be sorted, but when I
try to assign the DataView as the datasource for the DataGrid and write the
XML file from the DataSet the rows appear in the original order. Somehow the
sorted rows do not appear to have found their way to the DataSet. Does
anyone have any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top