Hi.
I have a combo box created using xaml. I bind the item source to a xml document.
<ComboBox Name="cb1" ItemsSource="{Binding Source={StaticResource myList}, XPath=Items/Item}" DisplayMemberPath="Name"/>
I would like to sort the combobox items so that the items are displayd in ascending order.
I manage to sort the above list by using SortDescription as below :
SortDescription sd = new SortDescription("Name", ListSortDirection.Ascending);
cb1.Items.SortDescriptions.Add(sd);
The combobox will display the items in the following order.
David
George
Marcus
Now, when I add a node to the xml document, I added CData to handle invalid characters. The xml document will be updated as below :
When I do this, the sorting failed. The node with CData is always sorted to the top of the list.
PeterM
David
George
Marcus
Any idea what I can do to solve this problem?
Thanks.
Venkatesh EllurPosted Oct 23, 2009, 1:22 AM
Master BillaPosted Oct 22, 2009, 11:52 AM
I think you can do this way
http://www.kudzuworld.com/Blogs/Tech/20070815A.en.aspx
thank you
AndrePosted Oct 22, 2009, 9:40 AM
Mike GoldPosted May 7, 2008, 9:44 PM
sounds very much like a bug in WPF, and you should report it to Microsoft's Forum.
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1
Best,