Cerebrus
unread,Feb 5, 2008, 11:33:52 AM2/5/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Well, you are correct that the XmlDataSource does not support sorting
directly. But there are many ways to bind a DataGridView :
1. Sort your XML before loading it into the XmlDataSource.
2. Iterate through the nodes of the XML and get the relevant ones into
an Collection/ArrayList which can be sorted. Bind to this collection.
3. Convert the XML to a DataSet, get the default DataView and sort
that. Then bind your DGV to the DataView.
4. Use an XSLT stylesheet to transform the XML (in other words, sort
it) by using the TransformFile property of the XmlDataSource.
5...
6...
...
I would recommend Method 4 as the best method.